結果

問題 No.305 鍵(2)
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-16 17:46:43
言語 Ruby
(3.3.0)
結果
AC  
実行時間 108 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 349 ms
コンパイル使用メモリ 11,164 KB
実行使用メモリ 31,408 KB
平均クエリ数 86.69
最終ジャッジ日時 2023-09-24 01:42:53
合計ジャッジ時間 3,091 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
31,140 KB
testcase_01 AC 103 ms
31,040 KB
testcase_02 AC 104 ms
31,044 KB
testcase_03 AC 107 ms
31,156 KB
testcase_04 AC 107 ms
31,248 KB
testcase_05 AC 105 ms
31,148 KB
testcase_06 AC 98 ms
30,932 KB
testcase_07 AC 106 ms
31,408 KB
testcase_08 AC 103 ms
31,044 KB
testcase_09 AC 105 ms
30,712 KB
testcase_10 AC 108 ms
31,168 KB
testcase_11 AC 105 ms
31,168 KB
testcase_12 AC 102 ms
30,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(s,n)
	m=0
	ans=0
	10.times{|i|
		s[n]=i.to_s
		puts s
		STDOUT.flush
		t=gets.split
		n1=t[0].to_i
		if n1==10
			return true 
		elsif m<n1
			m=n1
			ans=i
		end
	}
	s[n]=ans.to_s[0]
	f(s,n+1)
end
f("0"*10,0)
0