結果

問題 No.2667 Constrained Permutation
ユーザー ゼットゼット
提出日時 2024-03-08 21:46:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 252 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,008 KB
最終ジャッジ日時 2024-03-08 21:46:58
合計ジャッジ時間 8,541 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,332 KB
testcase_01 AC 33 ms
53,332 KB
testcase_02 AC 40 ms
55,456 KB
testcase_03 AC 45 ms
60,980 KB
testcase_04 AC 57 ms
68,692 KB
testcase_05 AC 38 ms
55,456 KB
testcase_06 AC 56 ms
68,692 KB
testcase_07 AC 38 ms
55,456 KB
testcase_08 AC 78 ms
68,692 KB
testcase_09 AC 57 ms
68,692 KB
testcase_10 AC 42 ms
57,504 KB
testcase_11 AC 56 ms
68,692 KB
testcase_12 AC 114 ms
81,124 KB
testcase_13 AC 59 ms
70,764 KB
testcase_14 AC 222 ms
90,984 KB
testcase_15 AC 184 ms
87,520 KB
testcase_16 AC 148 ms
83,040 KB
testcase_17 AC 84 ms
78,948 KB
testcase_18 AC 250 ms
91,240 KB
testcase_19 AC 226 ms
91,112 KB
testcase_20 AC 225 ms
91,752 KB
testcase_21 AC 224 ms
92,008 KB
testcase_22 AC 233 ms
91,112 KB
testcase_23 AC 252 ms
91,368 KB
testcase_24 AC 128 ms
81,636 KB
testcase_25 AC 190 ms
87,664 KB
testcase_26 AC 227 ms
91,368 KB
testcase_27 AC 228 ms
91,260 KB
testcase_28 AC 194 ms
87,268 KB
testcase_29 AC 193 ms
84,824 KB
testcase_30 AC 184 ms
87,140 KB
testcase_31 AC 143 ms
82,144 KB
testcase_32 AC 82 ms
76,772 KB
testcase_33 WA -
testcase_34 AC 153 ms
83,416 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 182 ms
86,872 KB
testcase_39 AC 58 ms
70,772 KB
testcase_40 AC 146 ms
84,064 KB
testcase_41 AC 205 ms
90,464 KB
testcase_42 AC 159 ms
83,040 KB
testcase_43 AC 201 ms
87,136 KB
testcase_44 AC 116 ms
81,124 KB
testcase_45 AC 65 ms
70,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
l=0
r=10**10
L=[]
R=[]
for i in range(N):
  a,b=map(int,input().split())
  L.append(a-1)
  R.append(b-1)
L.sort()
R.sort()
for i in range(N):
  l=max(l,L[i]-i)
for i in range(N):
  r=min(r,R[i]-i)
if l<=r:
  print(r-l+1)
else:
  print(0)
0