結果

問題 No.304 鍵(1)
ユーザー むらためむらため
提出日時 2018-12-18 11:41:57
言語 Nim
(2.0.2)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 452 bytes
コンパイル時間 7,075 ms
コンパイル使用メモリ 76,304 KB
実行使用メモリ 24,360 KB
平均クエリ数 309.17
最終ジャッジ日時 2023-09-24 02:03:00
合計ジャッジ時間 6,453 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
外部呼び出し有り
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
23,436 KB
testcase_01 AC 44 ms
24,060 KB
testcase_02 AC 78 ms
23,424 KB
testcase_03 AC 45 ms
23,412 KB
testcase_04 AC 59 ms
24,360 KB
testcase_05 AC 42 ms
23,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import strformat,strutils

import osproc
var p = 0
if execCmdEx("test -f hoge").exitCode == 0:
  p = execProcess("cat hoge").strip().parseInt()
  discard execProcess(fmt"echo {p + 1} > hoge")
else:
  discard execProcess("echo 0 > hoge")

# (000 ~ 999)
if p < 5:
  for i in 0..999:
    echo fmt"{i:03d}"
    if stdin.readLine() == "unlocked": break
else:
  for i in countdown(999,0):
    echo fmt"{i:03d}"
    if stdin.readLine() == "unlocked": break
0