結果

問題 No.24 数当てゲーム
ユーザー o_chan_1998o_chan_1998
提出日時 2022-03-22 19:32:38
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 1,089 bytes
コンパイル時間 7,925 ms
コンパイル使用メモリ 149,184 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 18:45:01
合計ジャッジ時間 8,521 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	{ 数値入力待ち:変数N }
	var N: int :: cui@inputInt()
	
	{ 解答配列準備:ans[10] }
	var ans: []int :: #[10]int
	
	{ counter=0 }
	var counter: int :: 0
	
	{ answer=0 }
	var answer: int :: 0
	
	{ i = 0 to N-1 }
	for(0, N - 1)
		{ スペース区切りの文字列受付A_i, B_i, C_i, D_i, R_i }
		var temp: [][]char :: cui@input().split(" ")
		
		{ R_i==YES }
		if(temp[4] = "YES")
			{ ans[A_i]を+1 }
			do ans[temp[0].toInt(&)] :+ 1
			{ ans[B_i]を+1 }
			do ans[temp[1].toInt(&)] :+ 1
			{ ans[C_i]を+1 }
			do ans[temp[2].toInt(&)] :+ 1
			{ ans[D_i]を+1 }
			do ans[temp[3].toInt(&)] :+ 1
			{ counterを+1 }
			do counter :+ 1
		else
			{ ans[A_i]を-1 }
			do ans[temp[0].toInt(&)] :- 1
			{ ans[B_i]を-1 }
			do ans[temp[1].toInt(&)] :- 1
			{ ans[C_i]を-1 }
			do ans[temp[2].toInt(&)] :- 1
			{ ans[D_i]を-1 }
			do ans[temp[3].toInt(&)] :- 1
		end if
	end for
	
	{ i = 0 to 9 }
	for i(0, 9)
		{ ans[i]>=counter }
		if a(ans[i] >= counter)
			{ answer = i }
			do answer :: i
			break a
		end if
	end for
	
	do cui@print("\{answer}\n")
end func
0