結果

問題 No.432 占い(Easy)
ユーザー tookunn_1213tookunn_1213
提出日時 2016-10-14 22:35:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 332 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-05-01 23:28:06
合計ジャッジ時間 3,150 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 33 ms
10,624 KB
testcase_05 AC 28 ms
10,624 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 28 ms
10,752 KB
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 28 ms
10,624 KB
testcase_10 AC 30 ms
10,752 KB
testcase_11 AC 60 ms
10,752 KB
testcase_12 RE -
testcase_13 AC 380 ms
11,264 KB
testcase_14 AC 62 ms
10,752 KB
testcase_15 AC 28 ms
10,752 KB
testcase_16 AC 27 ms
10,624 KB
testcase_17 RE -
testcase_18 AC 197 ms
10,752 KB
testcase_19 AC 137 ms
10,752 KB
testcase_20 AC 75 ms
10,752 KB
testcase_21 AC 82 ms
10,752 KB
testcase_22 AC 31 ms
10,752 KB
testcase_23 AC 29 ms
10,752 KB
testcase_24 AC 30 ms
10,752 KB
testcase_25 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
S = [input() for i in range(T)]
def dfs(s):
	if len(s) == 1:
		return s[0]
	next = ''
	for i in range(len(s) - 1):
		ss = int(s[i]) + int(s[i + 1])
		if ss >= 10:
			ss = ss // 10 + ss % 10
		next += str(ss)
	return dfs(next)
for i in range(T):
	if len(S[i]) == 1:
		print(S[i])
		continue
	else:
		print(dfs(S[i]))
0