結果

問題 No.305 鍵(2)
ユーザー hama_duhama_du
提出日時 2015-11-27 22:40:28
言語 Go
(1.22.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 542 bytes
コンパイル時間 14,710 ms
コンパイル使用メモリ 213,840 KB
実行使用メモリ 24,420 KB
平均クエリ数 92.62
最終ジャッジ日時 2023-09-23 20:56:57
合計ジャッジ時間 13,040 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
23,424 KB
testcase_01 AC 28 ms
24,048 KB
testcase_02 AC 30 ms
23,460 KB
testcase_03 AC 29 ms
24,036 KB
testcase_04 AC 28 ms
24,420 KB
testcase_05 AC 29 ms
24,048 KB
testcase_06 AC 25 ms
23,628 KB
testcase_07 AC 28 ms
24,060 KB
testcase_08 AC 28 ms
24,072 KB
testcase_09 AC 29 ms
23,436 KB
testcase_10 AC 28 ms
23,664 KB
testcase_11 AC 28 ms
24,312 KB
testcase_12 AC 28 ms
23,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main
import "fmt"

func main()  {
	ans := ""
	for i := 0 ; i <= 9 ; i++ {
		best := -1
		bestD := -1
		for d := 0 ; d <= 9 ; d++ {
			query := ""
			for j := 0 ; j <= 9 ; j++ {
				if i == j {
					query += fmt.Sprintf("%d", d)
				} else {
					query += "0"
				}
			}
			fmt.Println(query)

			num := 0
			res := ""
			fmt.Scan(&num, &res)
			if num == 10 {
				return
			}
			if best < num {
				best = num
				bestD = d
			}
		}
		ans += fmt.Sprintf("%d", bestD)
	}

	num := 0
	res := ""
	fmt.Println(ans)
	fmt.Scan(&num, &res)
}
0