結果

問題 No.1605 Matrix Shape
ユーザー tonyu0tonyu0
提出日時 2022-09-21 11:59:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 274 ms
コンパイル使用メモリ 86,872 KB
実行使用メモリ 101,396 KB
最終ジャッジ日時 2023-08-23 19:54:04
合計ジャッジ時間 9,403 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
78,600 KB
testcase_01 AC 75 ms
78,676 KB
testcase_02 AC 77 ms
78,416 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 79 ms
78,476 KB
testcase_07 AC 78 ms
78,604 KB
testcase_08 WA -
testcase_09 AC 76 ms
78,496 KB
testcase_10 AC 80 ms
78,548 KB
testcase_11 AC 80 ms
78,740 KB
testcase_12 WA -
testcase_13 AC 76 ms
78,540 KB
testcase_14 AC 78 ms
78,544 KB
testcase_15 AC 75 ms
78,528 KB
testcase_16 AC 76 ms
78,576 KB
testcase_17 AC 75 ms
78,588 KB
testcase_18 AC 76 ms
78,500 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 265 ms
100,260 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 270 ms
100,196 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 259 ms
100,444 KB
testcase_28 WA -
testcase_29 AC 260 ms
100,308 KB
testcase_30 WA -
testcase_31 AC 274 ms
100,184 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 236 ms
96,148 KB
testcase_36 AC 182 ms
90,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=[list(map(int, input().split())) for i in range(n)]

M=200001
X=[0]*M
Y=[0]*M
for x, y in a:
    X[x]+=1
    Y[y]+=1
c=0
for i in range(M):
    c+=abs(X[i]-Y[i])
c//=2
if c==0:
    print(2)
elif c==1:
    print(1)
else:
    print(0)
0