結果
問題 |
No.648 お や す み
|
ユーザー |
|
提出日時 | 2019-01-17 20:38:11 |
言語 | Nim (2.2.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 267 bytes |
コンパイル時間 | 3,313 ms |
コンパイル使用メモリ | 63,872 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 10:11:37 |
合計ジャッジ時間 | 5,526 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 WA * 38 RE * 20 |
ソースコード
import strutils,math template get*():string = stdin.readLine().strip() proc sqrt(n:int):int = n.float.sqrt.int let n = get().parseInt() let c = 1 + 8 * n if c.sqrt * c.sqrt != c or c.sqrt mod 2 == 0: quit "NO",0 echo "YES\n",(c.sqrt - 1 ) div 2 # x * (x+1) div 2 == n