結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  foumi | 
| 提出日時 | 2019-04-03 12:58:58 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 32 ms / 5,000 ms | 
| コード長 | 704 bytes | 
| コンパイル時間 | 144 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-12-17 23:09:24 | 
| 合計ジャッジ時間 | 1,025 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
N = int(input())
yes = []
no = []
for n in range(N):
    L = input().split()
    if L[-1] == 'YES':
        yes.extend(L[0:4])
    else:
        no.extend(L[0:4])
if len(yes) == 0:
    for i in range(10):
        if not str(i) in no:
            print(i)
elif len(no) != 0:
    for n in no:
        if n in yes:
            yes.remove(n)
    count = 0
    ans = ''
    for i in range(10):
        if yes.count(str(i)) > count:
            count = yes.count(str(i))
            ans = i
    print(ans)
else:
    count = 1
    ans = ''
    for i in range(10):
        if yes.count(str(i)) > count:
            count = yes.count(str(i))
            ans = i
    print(ans)
            
            
            
        