結果
問題 | No.71 そろばん |
ユーザー |
|
提出日時 | 2019-01-21 12:52:56 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 328 bytes |
コンパイル時間 | 2,167 ms |
コンパイル使用メモリ | 61,100 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 10:29:21 |
合計ジャッジ時間 | 2,924 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
template `max=`*(x,y) = x = max(x,y)proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}proc scan(): int =while true:let k = getchar_unlocked()if k < '0': breakresult = 10 * result + k.ord - '0'.ordlet n = scan()var ans = 0for i in 1..<n: ans .max= i + (i+1) * (n-i)echo ans