結果

問題 No.1455 拡張ROTN
ユーザー あかりきあかりき
提出日時 2021-04-13 16:54:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 748 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 76,372 KB
最終ジャッジ日時 2023-09-12 09:13:13
合計ジャッジ時間 4,112 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,172 KB
testcase_01 AC 74 ms
71,452 KB
testcase_02 AC 96 ms
76,100 KB
testcase_03 AC 81 ms
75,944 KB
testcase_04 AC 84 ms
76,156 KB
testcase_05 AC 79 ms
76,144 KB
testcase_06 AC 83 ms
76,124 KB
testcase_07 AC 82 ms
76,068 KB
testcase_08 AC 82 ms
76,036 KB
testcase_09 AC 79 ms
76,372 KB
testcase_10 AC 73 ms
71,416 KB
testcase_11 AC 74 ms
71,208 KB
testcase_12 AC 78 ms
76,020 KB
testcase_13 AC 72 ms
71,476 KB
testcase_14 AC 77 ms
76,164 KB
testcase_15 AC 78 ms
71,472 KB
testcase_16 AC 73 ms
71,164 KB
testcase_17 AC 75 ms
71,516 KB
testcase_18 AC 76 ms
75,984 KB
testcase_19 AC 79 ms
75,864 KB
testcase_20 AC 76 ms
71,224 KB
testcase_21 AC 74 ms
71,256 KB
testcase_22 AC 73 ms
71,380 KB
testcase_23 AC 79 ms
76,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=list(input())
n=int(input())

c=[chr(i) for i in range(97, 97+26)]
C=[chr(i) for i in range(65, 65+26)]
for i in range(min(n,10)):
  for j in range(len(s)):
    if s[j] in c:
      s[j]=c[(c.index(s[j])+1)%26]
    elif s[j] in C:
      s[j]=C[(C.index(s[j])+1)%26]
    elif s[j]=='9':
      s[j]='CpCzNkSuTbEoA'
    else:
      s[j]=str(int(s[j])+1)
  s=list(''.join(s))

if n<=10:
  print(''.join(s))
  exit()

n-=10
n%=26
for i in range(len(s)):
  if s[i] in c:
    s[i]=c[(c.index(s[i])+n)%26]
  elif s[i] in C:
    s[i]=C[(C.index(s[i])+n)%26]
print(''.join(s))
0