結果

問題 No.432 占い(Easy)
ユーザー curryudon08curryudon08
提出日時 2020-07-21 17:58:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 747 bytes
コンパイル時間 4,225 ms
コンパイル使用メモリ 101,904 KB
実行使用メモリ 26,104 KB
最終ジャッジ日時 2023-08-28 19:07:40
合計ジャッジ時間 6,047 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,828 KB
testcase_01 AC 59 ms
23,864 KB
testcase_02 AC 59 ms
21,744 KB
testcase_03 AC 60 ms
23,788 KB
testcase_04 AC 60 ms
21,784 KB
testcase_05 AC 59 ms
21,840 KB
testcase_06 AC 59 ms
21,844 KB
testcase_07 AC 60 ms
23,896 KB
testcase_08 AC 59 ms
21,868 KB
testcase_09 AC 64 ms
21,908 KB
testcase_10 AC 61 ms
21,688 KB
testcase_11 AC 62 ms
23,784 KB
testcase_12 AC 71 ms
26,040 KB
testcase_13 AC 71 ms
26,104 KB
testcase_14 AC 60 ms
19,696 KB
testcase_15 AC 59 ms
21,824 KB
testcase_16 AC 60 ms
23,728 KB
testcase_17 AC 69 ms
25,924 KB
testcase_18 AC 66 ms
23,884 KB
testcase_19 AC 63 ms
23,792 KB
testcase_20 AC 61 ms
23,912 KB
testcase_21 AC 61 ms
21,756 KB
testcase_22 AC 61 ms
21,828 KB
testcase_23 AC 62 ms
21,840 KB
testcase_24 AC 62 ms
21,824 KB
testcase_25 AC 63 ms
21,744 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.Linq;
using System.Collections.Generic;

namespace _0432
{
    class Program
    {
        static void Main(string[] args)
        {
            var t = long.Parse(Console.ReadLine());

            for(var i = 0; i < t; i++){
                var s = Console.ReadLine().ToCharArray().Select(x => int.Parse(x.ToString())).ToList();
                while(s.Count > 1){
                    var l = new List<int>();
                    for(var j = 0; j < s.Count - 1; j++){
                        var n = s[j] + s[j + 1];
                        l.Add(n >= 10 ? n % 10 + 1 : n);
                    }
                    s = l;
                }
                Console.WriteLine(s.First());
            }
        }
    }
}
0