結果
| 問題 |
No.24 数当てゲーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-22 19:32:38 |
| 言語 | Kuin (KuinC++ v.2021.9.17) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 1,089 bytes |
| コンパイル時間 | 8,444 ms |
| コンパイル使用メモリ | 149,212 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-10 12:05:28 |
| 合計ジャッジ時間 | 9,163 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
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