結果
問題 |
No.2142 Segment Zero
|
ユーザー |
![]() |
提出日時 | 2022-12-02 22:27:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 242 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 61,812 KB |
最終ジャッジ日時 | 2024-10-09 23:57:09 |
合計ジャッジ時間 | 3,279 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 21 WA * 14 |
ソースコード
from math import sqrt N,K=map(int,input().split()) SUM=0 ANS=2 for i in range(N,-1,-1): rest=K-SUM if rest<0: continue x=round((-1+sqrt(1+9*rest))/2) if x*(x+1)==rest*2 and x<i: ANS=1 SUM+=i print(ANS)