結果

問題 No.2142 Segment Zero
ユーザー とりゐとりゐ
提出日時 2022-12-02 21:48:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 347 ms / 2,000 ms
コード長 174 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 224,768 KB
最終ジャッジ日時 2024-04-18 05:42:05
合計ジャッジ時間 8,743 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,456 KB
testcase_01 AC 325 ms
224,512 KB
testcase_02 AC 41 ms
51,712 KB
testcase_03 AC 41 ms
51,840 KB
testcase_04 AC 326 ms
224,768 KB
testcase_05 AC 328 ms
224,640 KB
testcase_06 AC 41 ms
52,224 KB
testcase_07 AC 106 ms
102,656 KB
testcase_08 AC 343 ms
224,768 KB
testcase_09 AC 207 ms
159,600 KB
testcase_10 AC 331 ms
224,640 KB
testcase_11 AC 347 ms
224,512 KB
testcase_12 AC 332 ms
224,768 KB
testcase_13 AC 327 ms
224,768 KB
testcase_14 AC 329 ms
224,368 KB
testcase_15 AC 335 ms
224,640 KB
testcase_16 AC 334 ms
224,612 KB
testcase_17 AC 283 ms
193,536 KB
testcase_18 AC 53 ms
62,848 KB
testcase_19 AC 78 ms
79,360 KB
testcase_20 AC 192 ms
149,120 KB
testcase_21 AC 172 ms
131,200 KB
testcase_22 AC 255 ms
179,712 KB
testcase_23 AC 88 ms
90,752 KB
testcase_24 AC 118 ms
107,520 KB
testcase_25 AC 88 ms
90,492 KB
testcase_26 AC 180 ms
139,956 KB
testcase_27 AC 112 ms
103,040 KB
testcase_28 AC 161 ms
131,840 KB
testcase_29 AC 191 ms
148,992 KB
testcase_30 AC 257 ms
179,968 KB
testcase_31 AC 52 ms
62,464 KB
testcase_32 AC 97 ms
97,792 KB
testcase_33 AC 69 ms
77,440 KB
testcase_34 AC 98 ms
97,920 KB
testcase_35 AC 339 ms
224,128 KB
testcase_36 AC 93 ms
93,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
s=set()
s.add(0)
tmp=0
m=n*(n+1)//2-k
for i in range(1,n+1):
  tmp+=i
  s.add(tmp)
  if tmp-m in s:
    print(1)
    exit()
  s.add(tmp)
print(2)
0