結果

問題 No.1455 拡張ROTN
ユーザー mono_0812mono_0812
提出日時 2021-03-31 22:09:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 1,006 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 10,248 KB
最終ジャッジ日時 2023-08-22 02:10:24
合計ジャッジ時間 2,331 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,108 KB
testcase_01 AC 31 ms
10,188 KB
testcase_02 AC 33 ms
10,164 KB
testcase_03 AC 31 ms
10,240 KB
testcase_04 AC 32 ms
10,168 KB
testcase_05 AC 33 ms
10,200 KB
testcase_06 AC 32 ms
10,232 KB
testcase_07 AC 31 ms
10,248 KB
testcase_08 AC 32 ms
10,096 KB
testcase_09 AC 31 ms
10,100 KB
testcase_10 AC 31 ms
10,096 KB
testcase_11 AC 32 ms
10,192 KB
testcase_12 AC 32 ms
10,076 KB
testcase_13 AC 32 ms
10,164 KB
testcase_14 AC 32 ms
10,212 KB
testcase_15 AC 31 ms
10,232 KB
testcase_16 AC 31 ms
10,172 KB
testcase_17 AC 32 ms
10,084 KB
testcase_18 AC 31 ms
10,112 KB
testcase_19 AC 31 ms
10,108 KB
testcase_20 AC 32 ms
10,136 KB
testcase_21 AC 32 ms
10,224 KB
testcase_22 AC 32 ms
10,212 KB
testcase_23 AC 31 ms
10,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect,collections,copy,heapq,itertools,math,string,sys,queue
from decimal import Decimal
def I(): return input()
def IS(): return input().split()
def II(): return int(input())
def IIS(): return map(int,input().split())
def LIIS(): return list(map(int,input().split()))
def ZER(N): return [False for _ in range(N)]
INF=float("inf")
MOD=10**9+7
#     V
#   / ̄ψ ̄\
#  | 合格祈願 |
#  |_____|
##############################################################################
def rot_n(s, n):
    global N
    answer = ''
    for letter in s:
        if letter.isupper():
            answer += chr(ord('A') + (ord(letter)-ord('A')+n) % 26)
        elif letter.islower():
            answer += chr(ord('a') + (ord(letter)-ord('a')+n) % 26)
        else:
            val=int(letter)
            if val+N>9:
                answer+=rot_n("CpCzNkSuTbEoA",val+N-10)
            else:
                answer+=str(val+N)
    return answer
S=I();N=II()
print(rot_n(S,N))
0