Submission #1105835
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace abc54 { class Program { static void Main(string[] args){ bool res = false; var inp = ScanInt; int N = inp[0]; int M = inp[1]; string[] A = new string[N]; string[] B = new string[M]; for (int i = 0; i < N; i++) { A[i] = Console.ReadLine(); } for (int i = 0; i < M; i++) { B[i] = Console.ReadLine(); } for (int i = 0; i < N - M + 1; i++) { for (int j = 0; j < N - M + 1; j++) { // Console.WriteLine("@"); if(!res) res = check(A, B, i, j); } } if (res) { Console.WriteLine("Yes"); } else { Console.WriteLine("No"); } } static bool check(string[] a, string[] b, int i, int j) { for(int i1 = 0; i1 < b[0].Length; i1++) { for(int j1 = 0; j1 < b[0].Length; j1++) { Console.WriteLine((i + i1) +" "+ (j + j1)); if (a[j + j1][i + i1] != b[j1][i1]) { return false; } } } return true; } static int[] ScanInt { get { return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse); } } static string[] Scan { get { return Console.ReadLine().Split(' '); } } } }
Submission Info
Submission Time | |
---|---|
Task | B - Template Matching |
User | rui0422 |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 1938 Byte |
Status | WA |
Exec Time | 28 ms |
Memory | 11220 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample_01.txt | WA | 21 ms | 11092 KB |
sample_02.txt | WA | 21 ms | 11220 KB |
subtask_1_01.txt | WA | 21 ms | 11220 KB |
subtask_1_02.txt | WA | 21 ms | 11092 KB |
subtask_1_03.txt | WA | 21 ms | 11092 KB |
subtask_1_04.txt | WA | 22 ms | 11092 KB |
subtask_1_05.txt | WA | 28 ms | 11220 KB |
subtask_1_06.txt | WA | 21 ms | 11092 KB |
subtask_1_07.txt | WA | 25 ms | 11092 KB |
subtask_1_08.txt | WA | 22 ms | 11092 KB |