結果

問題 No.1605 Matrix Shape
ユーザー tonyu0
提出日時 2022-09-21 11:59:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 223 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 100,352 KB
最終ジャッジ日時 2024-12-22 04:01:58
合計ジャッジ時間 7,767 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 16
権限があれば一括ダウンロードができます

ソースコード

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