Submission #36833421


Source Code Expand

Copy
#!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc279
# https://atcoder.jp/contests/abc279/tasks/abc279_c
import sys
from collections import Counter
def i2s(): return sys.stdin.readline().rstrip()
def i2nn(): return list(map(int, i2s().split()))
YN=['No','Yes']
H,W=i2nn()
S=[i2s() for _ in range(H)]
T=[i2s() for _ in range(H)]
print(YN[
Counter(tuple(S[r][c] for r in range(H)) for c in range(W)) ==
Counter(tuple(T[r][c] for r in range(H)) for c in range(W))
])
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
# https://atcoder.jp/contests/abc279
# https://atcoder.jp/contests/abc279/tasks/abc279_c

import sys
from collections import Counter

def i2s(): return sys.stdin.readline().rstrip()
def i2nn(): return list(map(int, i2s().split()))
YN=['No','Yes']

H,W=i2nn()
S=[i2s() for _ in range(H)]
T=[i2s() for _ in range(H)]
print(YN[
    Counter(tuple(S[r][c] for r in range(H)) for c in range(W)) ==
    Counter(tuple(T[r][c] for r in range(H)) for c in range(W))
    ])

Submission Info

Submission Time
Task C - RANDOM
User kairi_003
Language PyPy3 (7.3.0)
Score 300
Code Size 529 Byte
Status AC
Exec Time 336 ms
Memory 201792 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 74
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt, test_44.txt, test_45.txt, test_46.txt, test_47.txt, test_48.txt, test_49.txt, test_50.txt, test_51.txt, test_52.txt, test_53.txt, test_54.txt, test_55.txt, test_56.txt, test_57.txt, test_58.txt
Case Name Status Exec Time Memory
hand_01.txt AC 181 ms 92868 KB
hand_02.txt AC 169 ms 93128 KB
hand_03.txt AC 195 ms 113628 KB
hand_04.txt AC 184 ms 113256 KB
hand_05.txt AC 185 ms 136740 KB
hand_06.txt AC 215 ms 140140 KB
hand_07.txt AC 176 ms 137816 KB
hand_08.txt AC 176 ms 138268 KB
hand_09.txt AC 207 ms 139816 KB
hand_10.txt AC 178 ms 135468 KB
hand_11.txt AC 178 ms 137584 KB
hand_12.txt AC 201 ms 137456 KB
sample_01.txt AC 53 ms 65160 KB
sample_02.txt AC 54 ms 65060 KB
sample_03.txt AC 55 ms 64804 KB
sample_04.txt AC 49 ms 64888 KB
test_01.txt AC 53 ms 64676 KB
test_02.txt AC 57 ms 64740 KB
test_03.txt AC 52 ms 64604 KB
test_04.txt AC 52 ms 65096 KB
test_05.txt AC 57 ms 64780 KB
test_06.txt AC 55 ms 65080 KB
test_07.txt AC 61 ms 65132 KB
test_08.txt AC 55 ms 64808 KB
test_09.txt AC 55 ms 64872 KB
test_10.txt AC 53 ms 64804 KB
test_11.txt AC 54 ms 64732 KB
test_12.txt AC 53 ms 64760 KB
test_13.txt AC 53 ms 64732 KB
test_14.txt AC 53 ms 64800 KB
test_15.txt AC 52 ms 64744 KB
test_16.txt AC 58 ms 64876 KB
test_17.txt AC 54 ms 65144 KB
test_18.txt AC 54 ms 64856 KB
test_19.txt AC 54 ms 64784 KB
test_20.txt AC 53 ms 65080 KB
test_21.txt AC 54 ms 65152 KB
test_22.txt AC 54 ms 65048 KB
test_23.txt AC 58 ms 64808 KB
test_24.txt AC 53 ms 64876 KB
test_25.txt AC 52 ms 65140 KB
test_26.txt AC 56 ms 64876 KB
test_27.txt AC 53 ms 64812 KB
test_28.txt AC 54 ms 65096 KB
test_29.txt AC 54 ms 65052 KB
test_30.txt AC 50 ms 64828 KB
test_31.txt AC 60 ms 65076 KB
test_32.txt AC 57 ms 64800 KB
test_33.txt AC 52 ms 64812 KB
test_34.txt AC 52 ms 64808 KB
test_35.txt AC 54 ms 64856 KB
test_36.txt AC 53 ms 64696 KB
test_37.txt AC 161 ms 131648 KB
test_38.txt AC 160 ms 131736 KB
test_39.txt AC 130 ms 114324 KB
test_40.txt AC 156 ms 127840 KB
test_41.txt AC 91 ms 87756 KB
test_42.txt AC 125 ms 103732 KB
test_43.txt AC 132 ms 104840 KB
test_44.txt AC 115 ms 99372 KB
test_45.txt AC 103 ms 74788 KB
test_46.txt AC 102 ms 74500 KB
test_47.txt AC 92 ms 74960 KB
test_48.txt AC 133 ms 107312 KB
test_49.txt AC 130 ms 107192 KB
test_50.txt AC 152 ms 123892 KB
test_51.txt AC 325 ms 76048 KB
test_52.txt AC 334 ms 76052 KB
test_53.txt AC 336 ms 75912 KB
test_54.txt AC 314 ms 76140 KB
test_55.txt AC 298 ms 201640 KB
test_56.txt AC 311 ms 201624 KB
test_57.txt AC 298 ms 201792 KB
test_58.txt AC 295 ms 201792 KB


2025-04-05 (Sat)
21:29:50 +00:00