結果

問題 No.648  お や す み 
コンテスト
ユーザー むらため
提出日時 2019-01-17 20:38:11
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 267 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,514 ms
コンパイル使用メモリ 67,184 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-22 08:19:40
合計ジャッジ時間 4,310 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 38 RE * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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
0