結果

問題 No.1605 Matrix Shape
ユーザー とりゐとりゐ
提出日時 2021-07-16 21:39:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 713 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 82,516 KB
最終ジャッジ日時 2023-09-20 13:21:44
合計ジャッジ時間 7,874 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
79,964 KB
testcase_01 AC 108 ms
80,000 KB
testcase_02 AC 103 ms
80,172 KB
testcase_03 AC 111 ms
79,976 KB
testcase_04 WA -
testcase_05 AC 103 ms
79,784 KB
testcase_06 AC 101 ms
80,132 KB
testcase_07 AC 101 ms
80,000 KB
testcase_08 AC 103 ms
79,772 KB
testcase_09 AC 101 ms
79,984 KB
testcase_10 AC 101 ms
79,944 KB
testcase_11 WA -
testcase_12 AC 103 ms
79,992 KB
testcase_13 AC 103 ms
80,152 KB
testcase_14 AC 101 ms
79,896 KB
testcase_15 AC 103 ms
79,932 KB
testcase_16 AC 103 ms
79,788 KB
testcase_17 AC 104 ms
80,020 KB
testcase_18 AC 103 ms
79,956 KB
testcase_19 AC 241 ms
80,932 KB
testcase_20 AC 233 ms
80,688 KB
testcase_21 AC 232 ms
80,792 KB
testcase_22 WA -
testcase_23 AC 247 ms
81,164 KB
testcase_24 AC 238 ms
80,808 KB
testcase_25 AC 199 ms
81,240 KB
testcase_26 AC 200 ms
81,004 KB
testcase_27 AC 200 ms
80,760 KB
testcase_28 WA -
testcase_29 AC 197 ms
80,756 KB
testcase_30 AC 228 ms
81,084 KB
testcase_31 AC 225 ms
81,040 KB
testcase_32 AC 220 ms
80,984 KB
testcase_33 WA -
testcase_34 AC 201 ms
82,516 KB
testcase_35 AC 207 ms
81,256 KB
testcase_36 AC 175 ms
80,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
from collections import deque,Counter
#sys.setrecursionlimit(10**7)
int1=lambda x: int(x)-1

inp=lambda :int(input())
mi=lambda :map(int,input().split())
li=lambda :list(mi())
mi1=lambda :map(int1,input().split())
li1=lambda :list(mi1())
mis=lambda :map(str,input().split())
lis=lambda :list(mis())
pr=print

from collections import defaultdict
"""
#初期値 0
d=defaultdict(int)

#初期値 1
d=defaultdict(lambda:1)
"""

mod=10**9+7
Mod=998244353
INF=10**18
ans=0

n=inp()
h=[0]*200001
w=[0]*200001
for i in range(n):
  a,b=mi()
  h[a]+=1
  w[b]+=1
x=0
y=0
for i in range(200001):
  if h[i]!=w[i]:
    x+=1
  if h[i]>0:
    y+=1
if x==2:
  print(1)
elif x==0:
  print(y)
else:
  print(0)
0