Submission #953989
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); string s = Console.ReadLine(); string t = Console.ReadLine(); int S = s.Length; int T = t.Length; int len = Math.Min(S, T); int max = 0; for (int i = 1; i <= len; ++i) { if (s.Substring(S - i) == t.Substring(0, i)) { max = i; } } Console.WriteLine(Math.Max(S + T - max, N)); } }
Submission Info
Submission Time | |
---|---|
Task | A - Prefix and Suffix |
User | M_Saito |
Language | C# (Mono 4.6.2.0) |
Score | 200 |
Code Size | 586 Byte |
Status | AC |
Exec Time | 19 ms |
Memory | 2648 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 | 19 ms | 2648 KB |
0_01.txt | AC | 19 ms | 2648 KB |
0_02.txt | AC | 19 ms | 2648 KB |
1_00.txt | AC | 19 ms | 2648 KB |
1_01.txt | AC | 19 ms | 2648 KB |
1_02.txt | AC | 19 ms | 2648 KB |
1_03.txt | AC | 19 ms | 2648 KB |
1_04.txt | AC | 19 ms | 2648 KB |
1_05.txt | AC | 19 ms | 2648 KB |