結果

問題 No.305 鍵(2)
ユーザー n_knuun_knuu
提出日時 2016-04-05 01:31:12
言語 Nim
(2.0.2)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 4,538 ms
コンパイル使用メモリ 68,368 KB
実行使用メモリ 24,420 KB
平均クエリ数 44.08
最終ジャッジ日時 2023-09-23 23:43:28
合計ジャッジ時間 4,299 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,376 KB
testcase_01 AC 27 ms
23,712 KB
testcase_02 AC 25 ms
24,276 KB
testcase_03 AC 25 ms
23,688 KB
testcase_04 AC 27 ms
23,472 KB
testcase_05 AC 28 ms
23,520 KB
testcase_06 AC 24 ms
23,628 KB
testcase_07 AC 26 ms
23,412 KB
testcase_08 AC 26 ms
24,420 KB
testcase_09 AC 27 ms
24,048 KB
testcase_10 AC 26 ms
23,976 KB
testcase_11 AC 26 ms
23,376 KB
testcase_12 AC 27 ms
23,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils

var
  pin = "0000000000"
  X: int
echo(pin)
X = stdin.readline.split[0].parseInt
proc main =
  if X == 10: return
  for i in 0..<10:
    for j in 1..9:
      var pin_t = pin
      pin_t[i] = chr(ord('0')+j)
      echo(pin_t)
      let X_t = stdin.readline.split[0].parseInt
      if X_t == 10:
        return
      elif X_t < X:
        break
      elif X_t > X:
        X = X_t
        pin = pin_t
        break
main()
0