Submission #954981
Source Code Expand
#include<stdio.h> #include<iostream> #include<algorithm> #define REP(i,n) for(int i=0;i<(n);i++) #define RREP(i,n) for(int i=(n)-1;i>=0;i++) using namespace::std; int main(){ int n,ans; char s[200],t[200]; cin>>n>>s>>t; REP(i,n){ int j=0,f=1; if(s[i]==t[j])REP(k,n-i){ if(s[i]!=t[j]){ f*=0; } if(f){ printf("%d\n",n+i); return 0; } } } printf("%d\n",n*2); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Prefix and Suffix |
User | AtThatTime |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 425 Byte |
Status | WA |
Exec Time | 2 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_00.txt, 0_01.txt, 0_02.txt |
All | 0_00.txt, 0_01.txt, 0_02.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_00.txt | AC | 2 ms | 256 KB |
0_01.txt | AC | 2 ms | 256 KB |
0_02.txt | AC | 2 ms | 256 KB |
1_00.txt | AC | 2 ms | 256 KB |
1_01.txt | AC | 2 ms | 256 KB |
1_02.txt | AC | 2 ms | 256 KB |
1_03.txt | AC | 2 ms | 256 KB |
1_04.txt | WA | 2 ms | 256 KB |
1_05.txt | WA | 2 ms | 256 KB |