結果

問題 No.548 国士無双
ユーザー fagfagdfafagfagdfa
提出日時 2017-08-23 18:30:24
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 704 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 6,588 KB
実行使用メモリ 6,120 KB
最終ジャッジ日時 2023-09-19 08:42:00
合計ジャッジ時間 1,586 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 12 ms
5,856 KB
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

tmp_s = "abcdefghijklm"
dic = {}

for i in tmp_s:
    dic[i] = 0

s = raw_input()

for i in s:
    if dic[i] == 3 or i not in tmp_s:
        print "Impossible"
        sys.exit()
    else:
        dic[i] += 1

n2 = [0, []]
n1 = [0, []]
n0 = [0, []]

keys = dic.keys()


for i in keys:
    if dic[i] == 2:
        n2[0] += 1
        n2[1].append(i)
    elif dic[i] == 1:
        n1[0] += 1
        n1[1].append(i)
    else:
        n0[0] += 1
        n0[1].append(i)

print n0
print n1
print n2

if n2[0] == 1 and n0[0] == 1:
    print n0[1][0]
elif n0[0] == 1 and n2[0] == 0:
    print n2[1][0]
elif n0[0] == 0 and n2[0] == 0:
    x = sorted(n1[1])
    print x
    for i in x:
        print i
0