結果

問題 No.2142 Segment Zero
ユーザー 👑 timitimi
提出日時 2022-12-03 18:19:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 213 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 68,480 KB
最終ジャッジ日時 2024-04-19 04:31:15
合計ジャッジ時間 3,284 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,712 KB
testcase_01 AC 50 ms
65,664 KB
testcase_02 AC 37 ms
52,224 KB
testcase_03 AC 45 ms
64,640 KB
testcase_04 AC 60 ms
67,968 KB
testcase_05 AC 59 ms
67,968 KB
testcase_06 AC 38 ms
51,712 KB
testcase_07 AC 51 ms
67,072 KB
testcase_08 AC 59 ms
68,096 KB
testcase_09 AC 50 ms
67,072 KB
testcase_10 AC 59 ms
67,840 KB
testcase_11 AC 64 ms
68,096 KB
testcase_12 AC 63 ms
67,712 KB
testcase_13 AC 59 ms
67,712 KB
testcase_14 AC 61 ms
68,224 KB
testcase_15 AC 60 ms
68,480 KB
testcase_16 AC 60 ms
68,096 KB
testcase_17 AC 57 ms
66,560 KB
testcase_18 AC 43 ms
60,032 KB
testcase_19 AC 46 ms
60,544 KB
testcase_20 AC 52 ms
64,384 KB
testcase_21 AC 50 ms
63,872 KB
testcase_22 AC 56 ms
65,152 KB
testcase_23 AC 45 ms
60,160 KB
testcase_24 AC 49 ms
61,568 KB
testcase_25 AC 48 ms
62,464 KB
testcase_26 AC 50 ms
64,896 KB
testcase_27 AC 49 ms
65,152 KB
testcase_28 AC 52 ms
63,744 KB
testcase_29 AC 53 ms
64,256 KB
testcase_30 AC 57 ms
65,536 KB
testcase_31 AC 46 ms
64,256 KB
testcase_32 AC 46 ms
61,532 KB
testcase_33 AC 42 ms
59,264 KB
testcase_34 AC 47 ms
61,952 KB
testcase_35 AC 58 ms
67,584 KB
testcase_36 AC 48 ms
61,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int, input().split())
A=[i for i in range(1,N+1)]
r=0
c=0
KK=(1+N)*N//2-K
for l in range(N):
  while r<N and c<KK:
    c+=A[r]
    r+=1
  if c==KK:
    print(1)
    exit()
  c-=A[l]
print(2)
0