Submission #6500446
Source Code Expand
//https://atcoder.jp/contests/agc006/tasks/agc006_a #include <bits/stdc++.h> using namespace std; using ll=int64_t; #define FOR(i,a,b) for(int64_t i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) int main() { #if LOCAL&01 std::ifstream in("./test/sample-1.in"); //input.txt std::cin.rdbuf(in.rdbuf()); #endif ll N; cin>>N; string s,t; cin>>s>>t; ll cnt=0; for(;cnt<s.size();++cnt){ if (strncmp(&s[cnt],&t[0],s.size()-cnt)==0){ break; } } ll dup=s.size()-cnt; ll ans=(s.size()-dup)*2+dup; cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Prefix and Suffix |
User | tasogare66 |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 585 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 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 | 1 ms | 256 KB |
0_01.txt | AC | 1 ms | 256 KB |
0_02.txt | AC | 1 ms | 256 KB |
1_00.txt | AC | 1 ms | 256 KB |
1_01.txt | AC | 1 ms | 256 KB |
1_02.txt | AC | 1 ms | 256 KB |
1_03.txt | AC | 1 ms | 256 KB |
1_04.txt | AC | 1 ms | 256 KB |
1_05.txt | AC | 1 ms | 256 KB |