結果

問題 No.432 占い(Easy)
ユーザー takakintakakin
提出日時 2020-04-18 22:10:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 99 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 15,104 KB
最終ジャッジ日時 2024-04-14 21:16:33
合計ジャッジ時間 2,132 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,624 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 29 ms
10,624 KB
testcase_06 AC 29 ms
10,624 KB
testcase_07 AC 30 ms
10,624 KB
testcase_08 AC 29 ms
10,624 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 35 ms
10,624 KB
testcase_12 AC 97 ms
15,104 KB
testcase_13 AC 99 ms
14,976 KB
testcase_14 AC 36 ms
10,624 KB
testcase_15 AC 29 ms
10,752 KB
testcase_16 AC 30 ms
10,624 KB
testcase_17 AC 84 ms
15,104 KB
testcase_18 AC 59 ms
11,904 KB
testcase_19 AC 48 ms
11,264 KB
testcase_20 AC 38 ms
10,752 KB
testcase_21 AC 39 ms
11,008 KB
testcase_22 AC 31 ms
10,752 KB
testcase_23 AC 31 ms
10,624 KB
testcase_24 AC 30 ms
10,624 KB
testcase_25 AC 30 ms
10,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10000)
def f(S):
  if len(S)==1:
    return S[0]
  else:
    T=[]
    for i in range(len(S)-1):
      t=S[i]+S[i+1]
      if t>=10:
        t=t%10+1
      T.append(t)
    return f(T)
x=int(input())
for _ in range(x):
  print(f([int(s) for s in list(input())]))
0