Submission #64133868
Source Code Expand
Copy
def f(A, B):import hashlibN, M = len(A), len(B)if M > N:return "No"B_hash = hashlib.sha256(str(B).encode()).hexdigest()seen = set()cnt = 0for i in range(N - M + 1):sub = hashlib.sha256(str(A[i:i+M]).encode()).hexdigest()if sub == B_hash:cnt += 1if cnt >= 2:return "Yes"
def f(A, B):
import hashlib
N, M = len(A), len(B)
if M > N:
return "No"
B_hash = hashlib.sha256(str(B).encode()).hexdigest()
seen = set()
cnt = 0
for i in range(N - M + 1):
sub = hashlib.sha256(str(A[i:i+M]).encode()).hexdigest()
if sub == B_hash:
cnt += 1
if cnt >= 2:
return "Yes"
return "No"
N,M=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
print(f(A,B))
Submission Info
| Submission Time | |
|---|---|
| Task | A - Twice Subsequence |
| User | kotafuku |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 0 |
| Code Size | 527 Byte |
| Status | WA |
| Exec Time | 2243 ms |
| Memory | 708004 KiB |
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 03_medium_01.txt, 03_medium_02.txt, 03_medium_03.txt, 03_medium_04.txt, 03_medium_05.txt, 04_large_01.txt, 04_large_02.txt, 04_large_03.txt, 04_large_04.txt, 04_large_05.txt, 05_max_01.txt, 05_max_02.txt, 05_max_03.txt, 05_max_04.txt, 05_max_05.txt, 06_not_emerge_01.txt, 06_not_emerge_02.txt, 06_not_emerge_03.txt, 07_emerge_once_01.txt, 07_emerge_once_02.txt, 07_emerge_once_03.txt, 07_emerge_once_04.txt, 07_emerge_once_05.txt, 08_emerge_twice_01.txt, 08_emerge_twice_02.txt, 08_emerge_twice_03.txt, 08_emerge_twice_04.txt, 08_emerge_twice_05.txt, 09_one_two_only_01.txt, 09_one_two_only_02.txt, 09_one_two_only_03.txt, 09_one_two_only_04.txt, 09_one_two_only_05.txt, 09_one_two_only_06.txt, 09_one_two_only_07.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1185 ms | 99272 KiB |
| 00_sample_02.txt | AC | 190 ms | 99456 KiB |
| 00_sample_03.txt | AC | 191 ms | 99396 KiB |
| 01_handmade_01.txt | AC | 188 ms | 99312 KiB |
| 01_handmade_02.txt | AC | 245 ms | 125996 KiB |
| 01_handmade_03.txt | AC | 226 ms | 137784 KiB |
| 01_handmade_04.txt | AC | 226 ms | 137824 KiB |
| 01_handmade_05.txt | AC | 225 ms | 138120 KiB |
| 02_small_01.txt | AC | 190 ms | 99692 KiB |
| 02_small_02.txt | WA | 189 ms | 99416 KiB |
| 02_small_03.txt | WA | 188 ms | 99156 KiB |
| 02_small_04.txt | WA | 190 ms | 99552 KiB |
| 02_small_05.txt | AC | 190 ms | 99372 KiB |
| 03_medium_01.txt | AC | 189 ms | 99536 KiB |
| 03_medium_02.txt | AC | 190 ms | 99708 KiB |
| 03_medium_03.txt | WA | 192 ms | 99788 KiB |
| 03_medium_04.txt | AC | 190 ms | 99420 KiB |
| 03_medium_05.txt | WA | 190 ms | 99408 KiB |
| 04_large_01.txt | AC | 197 ms | 101416 KiB |
| 04_large_02.txt | WA | 460 ms | 168844 KiB |
| 04_large_03.txt | AC | 1069 ms | 287056 KiB |
| 04_large_04.txt | TLE | 2221 ms | 269916 KiB |
| 04_large_05.txt | TLE | 2222 ms | 309388 KiB |
| 05_max_01.txt | WA | 262 ms | 126204 KiB |
| 05_max_02.txt | WA | 411 ms | 157416 KiB |
| 05_max_03.txt | AC | 279 ms | 131696 KiB |
| 05_max_04.txt | TLE | 2223 ms | 312380 KiB |
| 05_max_05.txt | TLE | 2223 ms | 314152 KiB |
| 06_not_emerge_01.txt | TLE | 2243 ms | 701592 KiB |
| 06_not_emerge_02.txt | TLE | 2243 ms | 708004 KiB |
| 06_not_emerge_03.txt | TLE | 2241 ms | 664728 KiB |
| 07_emerge_once_01.txt | TLE | 2220 ms | 257732 KiB |
| 07_emerge_once_02.txt | TLE | 2222 ms | 313376 KiB |
| 07_emerge_once_03.txt | TLE | 2223 ms | 318012 KiB |
| 07_emerge_once_04.txt | TLE | 2222 ms | 313000 KiB |
| 07_emerge_once_05.txt | TLE | 2242 ms | 662036 KiB |
| 08_emerge_twice_01.txt | TLE | 2218 ms | 219052 KiB |
| 08_emerge_twice_02.txt | TLE | 2223 ms | 315464 KiB |
| 08_emerge_twice_03.txt | TLE | 2223 ms | 311232 KiB |
| 08_emerge_twice_04.txt | TLE | 2223 ms | 309720 KiB |
| 08_emerge_twice_05.txt | TLE | 2223 ms | 312552 KiB |
| 09_one_two_only_01.txt | TLE | 2223 ms | 309656 KiB |
| 09_one_two_only_02.txt | TLE | 2223 ms | 308348 KiB |
| 09_one_two_only_03.txt | TLE | 2223 ms | 308096 KiB |
| 09_one_two_only_04.txt | TLE | 2223 ms | 308192 KiB |
| 09_one_two_only_05.txt | TLE | 2223 ms | 307424 KiB |
| 09_one_two_only_06.txt | TLE | 2239 ms | 625976 KiB |
| 09_one_two_only_07.txt | TLE | 2223 ms | 309016 KiB |