結果

問題 No.432 占い(Easy)
ユーザー mbanmban
提出日時 2016-10-18 02:29:36
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 773 bytes
コンパイル時間 2,358 ms
コンパイル使用メモリ 104,604 KB
実行使用メモリ 23,672 KB
最終ジャッジ日時 2023-08-14 13:58:42
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
21,568 KB
testcase_01 AC 55 ms
21,500 KB
testcase_02 AC 54 ms
21,452 KB
testcase_03 AC 55 ms
23,620 KB
testcase_04 AC 56 ms
23,628 KB
testcase_05 AC 56 ms
23,484 KB
testcase_06 AC 58 ms
23,616 KB
testcase_07 AC 59 ms
21,532 KB
testcase_08 AC 58 ms
23,620 KB
testcase_09 AC 62 ms
23,588 KB
testcase_10 AC 58 ms
21,504 KB
testcase_11 AC 59 ms
23,660 KB
testcase_12 AC 66 ms
23,492 KB
testcase_13 AC 64 ms
23,672 KB
testcase_14 AC 58 ms
23,532 KB
testcase_15 AC 57 ms
21,668 KB
testcase_16 AC 57 ms
23,628 KB
testcase_17 AC 68 ms
23,652 KB
testcase_18 AC 65 ms
21,480 KB
testcase_19 AC 61 ms
21,496 KB
testcase_20 AC 60 ms
21,620 KB
testcase_21 AC 59 ms
21,544 KB
testcase_22 AC 61 ms
23,604 KB
testcase_23 AC 60 ms
21,652 KB
testcase_24 AC 61 ms
21,532 KB
testcase_25 AC 61 ms
21,636 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.Linq;
using System.Text;
using System.Threading.Tasks;


class Program
{
    static void Main()
    {
        int T = int.Parse(Console.ReadLine());
        for(int i = 0; i < T; i++)
        {
            Console.WriteLine(ans(Console.ReadLine()));
        }
    }
    static int ans(string s)
    {
        List<int> A = new List<int>(), B;
        B = s.Select(q => int.Parse(q.ToString())).ToList();
        while (B.Count>1)
        {
            for(int i = 0; i < B.Count - 1; i++)
            {
                int q = B[i] + B[i + 1];
                q = q % 10 + q / 10;
                A.Add(q);
            }
            B = A.ToList();
            A.Clear();
        }
        return B[0];
    }
}

0