結果

問題 No.548 国士無双
ユーザー rocoderrocoder
提出日時 2017-07-29 16:47:43
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 1,409 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,980 KB
実行使用メモリ 10,168 KB
最終ジャッジ日時 2023-10-17 16:02:38
合計ジャッジ時間 1,503 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#kokus
def na(n):
    if n==0:
        return "a"
    elif n==1:
        return "b"
    elif n==2:
        return "c"
    elif n==3:
        return "d"
    elif n==4:
        return "e"
    elif n==5:
        return "f"
    elif n==6:
        return "g"
    elif n==7:
        return "h"
    elif n==8:
        return "i"
    elif n==9:
        return "j"
    elif n==10:
        return "k"
    elif n==11:
        return "l"
    elif n==12:
        return "m"
def an(st):
    if st=="a":
        return 0
    elif st=="b":
        return 1
    elif st=="c":
        return 2
    elif st=="d":
        return 3
    elif st=="e":
        return 4
    elif st=="f":
        return 5
    elif st=="g":
        return 6
    elif st=="h":
        return 7
    elif st=="i":
        return 8
    elif st=="j":
        return 9
    elif st=="k":
        return 10
    elif st=="l":
        return 11
    elif st=="m":
        return 12
    else:
        return 14
S=input()
K=[0]*13
#rint (K)
for i in range(13):
    K[i]=0
nd=0
i=0
#print (K)
while i<13 and nd <2:
    t=an(S[i])
   # print (t)
    if t<13:
        K[t]+=1
        if K[t]>1:
            w=t
            nd+=1
    else:
        nd+=2
    i+=1
if nd>1:
    print ("Impossible")
else:
    i=0
    while i<13 and nd<2:
        if K[i]==0:
            print(na(i))
            nd=2
        elif K[i]==1 and nd==0:
            print (na(i))
        i+=1
0