Submission #1355736
Source Code Expand
import java.util.Scanner; import java.util.stream.IntStream; public class Main{ static final Scanner s=new Scanner(System.in); static int getInt(){ return Integer.parseInt(s.next()); } public static void main(String[] __){ int n=getInt(); String a=s.next(),b=s.next(); for(int i=0;i<n;i++) { String r=a.substring(i,n); if(b.startsWith(r)) { System.out.println((a+b.replaceFirst(r,"")).length()); return; } } System.out.println((a+b).length()); } }
Submission Info
Submission Time | |
---|---|
Task | A - Prefix and Suffix |
User | fal_rnd |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 504 Byte |
Status | AC |
Exec Time | 102 ms |
Memory | 23892 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 | 90 ms | 23892 KB |
0_01.txt | AC | 96 ms | 21844 KB |
0_02.txt | AC | 102 ms | 20692 KB |
1_00.txt | AC | 96 ms | 21716 KB |
1_01.txt | AC | 91 ms | 21716 KB |
1_02.txt | AC | 100 ms | 21844 KB |
1_03.txt | AC | 90 ms | 21844 KB |
1_04.txt | AC | 91 ms | 19924 KB |
1_05.txt | AC | 90 ms | 18644 KB |