結果
問題 |
No.634 硬貨の枚数1
|
ユーザー |
|
提出日時 | 2019-01-24 05:19:12 |
言語 | Nim (2.2.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 706 bytes |
コンパイル時間 | 2,365 ms |
コンパイル使用メモリ | 61,476 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-01 10:41:10 |
合計ジャッジ時間 | 4,778 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 59 WA * 16 |
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
ソースコード
import sequtils template times*(n:int,body) = (for _ in 0..<n: body) template `max=`*(x,y) = x = max(x,y) template `min=`*(x,y) = x = min(x,y) proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord let n = scan() const INF = 1000_0010 const C = (proc():seq[int] = result = @[] for i in 1..INF: let c = i * (i + 1) div 2 if c > INF : break result &= c )() for i,c in C: if n == c : quit "1",0 if c > n : break for i in 0..<C.len: for j in i..<C.len: let c = C[i] + C[j] if n == c: quit "2",0 if c > n : break echo 3