結果
問題 |
No.432 占い(Easy)
|
ユーザー |
|
提出日時 | 2017-02-17 17:14:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 104 ms / 2,000 ms |
コード長 | 673 bytes |
コンパイル時間 | 316 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 15,104 KB |
最終ジャッジ日時 | 2024-12-30 23:01:03 |
合計ジャッジ時間 | 2,575 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 22 |
ソースコード
import sys sys.setrecursionlimit(10**3 * 2) def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): T = int(input()) for test in range(T): S = [int(i) for i in input()] # debug(S, locals()) ans = uranai(S) print(ans) def uranai(S): if len(S) == 1: return S[0] else: S = [S[i] + S[i + 1] for i in range(len(S) - 1)] for i in range(len(S)): if S[i] >= 10: S[i] = 1 + S[i] % 10 return uranai(S) if __name__ == '__main__': solve()