結果

問題 No.432 占い(Easy)
ユーザー abL8ZLsTbFabL8ZLsTbF
提出日時 2016-10-14 22:36:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 4,520 ms
コンパイル使用メモリ 107,196 KB
実行使用メモリ 26,852 KB
最終ジャッジ日時 2023-08-14 11:09:57
合計ジャッジ時間 6,941 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
20,720 KB
testcase_01 AC 48 ms
22,708 KB
testcase_02 AC 53 ms
20,640 KB
testcase_03 AC 53 ms
20,640 KB
testcase_04 AC 51 ms
22,748 KB
testcase_05 AC 50 ms
22,652 KB
testcase_06 AC 47 ms
20,872 KB
testcase_07 AC 48 ms
18,768 KB
testcase_08 AC 47 ms
22,692 KB
testcase_09 AC 49 ms
22,748 KB
testcase_10 AC 50 ms
20,712 KB
testcase_11 AC 52 ms
22,612 KB
testcase_12 AC 86 ms
26,808 KB
testcase_13 AC 84 ms
24,828 KB
testcase_14 AC 52 ms
20,672 KB
testcase_15 AC 50 ms
20,700 KB
testcase_16 AC 51 ms
22,800 KB
testcase_17 AC 81 ms
26,852 KB
testcase_18 AC 68 ms
26,724 KB
testcase_19 AC 59 ms
24,748 KB
testcase_20 AC 52 ms
22,796 KB
testcase_21 AC 53 ms
22,824 KB
testcase_22 AC 49 ms
22,740 KB
testcase_23 AC 49 ms
20,808 KB
testcase_24 AC 50 ms
20,784 KB
testcase_25 AC 49 ms
20,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Text;

public class Program
{
	public static void Main()
	{
		int T = int.Parse(Console.ReadLine());
		for (int i = 0; i < T; i++)
		{
			var S = Console.ReadLine();
			while (S.Length > 1)
			{
				var sb = new StringBuilder();
				for (int j = 0; j < S.Length - 1; j++)
				{
					int temp = S[j] - '0' + S[j + 1] - '0';
					if (temp > 9)
					{
						temp = 1 + temp % 10;
					}
					sb.Append(temp.ToString());
				}
				S = sb.ToString();
			}
			Console.WriteLine(S);
		}
	}
}
0