Submission #954535
Source Code Expand
import std.stdio;
import std.string;
import std.conv;
void main(){
int n;
string s,t;
readf("%d\n%s\n%s\n",&n,&s,&t);
for(int i=0;i<n;++i){
if(s[i..n] == t[0..n-i]){
(s[0..i]~t[0..n]).length.writeln;
return;
}
}
(n*2).writeln;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - Prefix and Suffix |
| User | ray45422 |
| Language | D (DMD64 v2.070.1) |
| Score | 200 |
| Code Size | 260 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 256 KiB |
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 | 2 ms | 256 KiB |
| 0_01.txt | AC | 2 ms | 256 KiB |
| 0_02.txt | AC | 2 ms | 256 KiB |
| 1_00.txt | AC | 2 ms | 256 KiB |
| 1_01.txt | AC | 2 ms | 256 KiB |
| 1_02.txt | AC | 2 ms | 256 KiB |
| 1_03.txt | AC | 2 ms | 256 KiB |
| 1_04.txt | AC | 2 ms | 256 KiB |
| 1_05.txt | AC | 2 ms | 256 KiB |