結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
24,012 KB
testcase_01 AC 71 ms
24,288 KB
testcase_02 AC 41 ms
24,048 KB
testcase_03 AC 72 ms
24,372 KB
testcase_04 AC 59 ms
23,988 KB
testcase_05 AC 73 ms
23,400 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