結果

問題 No.327 アルファベット列
ユーザー rocoderrocoder
提出日時 2017-06-30 05:27:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,077 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-15 06:40:43
合計ジャッジ時間 3,017 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 WA -
testcase_02 AC 30 ms
10,880 KB
testcase_03 WA -
testcase_04 AC 30 ms
10,880 KB
testcase_05 RE -
testcase_06 AC 30 ms
10,880 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 RE -
testcase_21 RE -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 RE -
testcase_26 WA -
testcase_27 RE -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 RE -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 RE -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def nta(N):
    if N==0:
        a="A"
    elif N==1: 
        a="B"
    elif N==2:
        a="C"
    elif N==3:
        a="D"
    elif N==4:
        a="E"
    elif N==5:
        a="F"
    elif N==6:
        a="G"
    elif N==7:
        a="H"
    elif N==8:
        a="I"
    elif N==9:
        a="J"
    elif N==10:
        a="K"
    elif N==11:
        a="L"
    elif N==12:
        a="M"
    elif N==13:
        a="N"
    elif N==14:
        a="O"
    elif N==15:
        a="P"
    elif N==16:
        a="Q"
    elif N==17:
        a="R"
    elif N==18:
        a="S"
    elif N==19:
        a="T"
    elif N==20:
        a="U"
    elif N==21:
        a="V"
    elif N==22:
        a="W"
    elif N==23:
        a="X"
    elif N==24:
        a="Y"
    elif N==25:
        a="Z"
    return a
Nu=int(input())
S=""
i=1
k=26
while k<Nu:
    k*=27
    i+=1
if i>1:
    k//=27
    i-=1
Q=Nu//k
if Q>0:
    S+=nta(Q-1)
R=Nu%k
while R>0 and k>26:
    k//=27
    Q=R//k
    S+=nta(R//k)
    R%=k
    i-=1
if i==1:
    S+="A"
else:
    while i>1:
        S+="Z"
        i-=1
print (S)
0