結果

問題 No.24 数当てゲーム
ユーザー tkhrtkhr
提出日時 2014-11-23 16:12:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 693 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 6,664 KB
実行使用メモリ 6,072 KB
最終ジャッジ日時 2023-08-30 22:18:19
合計ジャッジ時間 889 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,948 KB
testcase_01 AC 11 ms
5,876 KB
testcase_02 AC 11 ms
5,980 KB
testcase_03 AC 11 ms
5,944 KB
testcase_04 AC 11 ms
6,072 KB
testcase_05 AC 11 ms
5,864 KB
testcase_06 AC 11 ms
5,856 KB
testcase_07 AC 11 ms
6,020 KB
testcase_08 AC 11 ms
6,064 KB
testcase_09 AC 11 ms
5,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#! /usr/bin/etc python
# coding: utf-8

def parse(l):
    i = l.split(" ")
    num = map(int, i[0:4])
    yn = i[4]
    return (num, yn)

def init(val):
    return [val] * 10

def inv(l):
    for i in xrange(len(l)):
        l[i] = (not l[i])
    return l

def liand(l1, l2):
    for i in xrange(len(l1)):
        l1[i] = l1[i] and l2[i]
    return l1

a = []
res = init(True)

n = int(raw_input(""))
for j in xrange(n):
    num, yn = parse(raw_input(""))
    a = init(False)
    for i in xrange(len(num)):
        a[num[i]] = True
    if yn == "NO":
        l = inv(a)
    res = liand(res, a)

for i in xrange(len(res)):
    if res[i]:
        print i

0