結果
| 問題 |
No.257 N言っちゃダメゲーム (3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-22 00:07:50 |
| 言語 | Nim (2.2.0) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 411 bytes |
| コンパイル時間 | 1,942 ms |
| コンパイル使用メモリ | 61,272 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 3.70 |
| 最終ジャッジ日時 | 2024-07-17 02:06:39 |
| 合計ジャッジ時間 | 5,191 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
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() # 21
let k = scan()
# 21:[1~3] -> 0 4 8 12 16 20
# 22:[1~3] -> 1 5 9 13 17 21
let s = (n-1) mod (k+1)
let d = k + 1
for i in 0..<n:
echo s + d * i
let m = scan()
if m >= n: break