結果

問題 No.305 鍵(2)
ユーザー 小指が強い人小指が強い人
提出日時 2015-11-27 22:59:13
言語 Ruby
(3.2.2)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 31,492 KB
平均クエリ数 78.08
最終ジャッジ日時 2023-09-23 22:02:11
合計ジャッジ時間 2,653 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
30,788 KB
testcase_01 AC 107 ms
30,628 KB
testcase_02 AC 110 ms
31,000 KB
testcase_03 AC 107 ms
31,492 KB
testcase_04 AC 106 ms
31,044 KB
testcase_05 AC 105 ms
31,376 KB
testcase_06 AC 104 ms
31,288 KB
testcase_07 AC 105 ms
31,376 KB
testcase_08 AC 103 ms
30,768 KB
testcase_09 AC 105 ms
31,140 KB
testcase_10 AC 105 ms
31,372 KB
testcase_11 AC 104 ms
31,220 KB
testcase_12 AC 108 ms
31,484 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a = Array.new(10, 0)
x = "%010d" % 0
puts x
STDOUT.flush
str = gets.split
zero_num = str[0].to_i
if str[1] == "unlocked"
    exit
end
9.times do |i|
    i += 1
    y = i
    10.times do |j|
        s = "%010d" % y
        puts s
        STDOUT.flush
        y *= 10
        str = gets.split
        if str[1] == "unlocked"
            exit
        end
        h = str[0].to_i
        if h > zero_num
            a[9 - j] = i
        end
    end
end
puts a.join
STDOUT.flush
0