結果

問題 No.432 占い(Easy)
ユーザー NoNo
提出日時 2016-10-14 23:31:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,176 bytes
コンパイル時間 2,112 ms
コンパイル使用メモリ 105,940 KB
実行使用メモリ 26,952 KB
最終ジャッジ日時 2023-08-14 10:23:26
合計ジャッジ時間 5,977 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
20,716 KB
testcase_01 WA -
testcase_02 AC 49 ms
22,708 KB
testcase_03 AC 48 ms
22,712 KB
testcase_04 AC 51 ms
20,708 KB
testcase_05 AC 49 ms
20,728 KB
testcase_06 WA -
testcase_07 AC 52 ms
20,668 KB
testcase_08 AC 48 ms
20,764 KB
testcase_09 WA -
testcase_10 AC 50 ms
20,844 KB
testcase_11 AC 77 ms
24,892 KB
testcase_12 AC 340 ms
24,812 KB
testcase_13 AC 335 ms
24,808 KB
testcase_14 AC 76 ms
26,896 KB
testcase_15 AC 48 ms
20,700 KB
testcase_16 AC 47 ms
22,732 KB
testcase_17 AC 252 ms
26,844 KB
testcase_18 AC 183 ms
26,888 KB
testcase_19 AC 133 ms
26,952 KB
testcase_20 AC 87 ms
26,896 KB
testcase_21 AC 98 ms
26,828 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace yukikoda
{
    class Program
    {
        static void Main(string[] args)
        {
            int t = int.Parse(Console.ReadLine());
            var s = new List<string>();
            for (int i = 0; i < t; i++)
            {
                s.Add(Console.ReadLine());
            }

            foreach (var item in s)
            {
                Console.WriteLine(aa(item));
            }
        }

        static string aa(string s)
        {
            int a;
            string s2 = "";

            while (s.Length != 1)
            {
                s2 = "";
                for (int i = 0; i < s.Length - 1; i++)
                {
                    a = int.Parse(s[i].ToString()) + int.Parse(s[i + 1].ToString());


                    if (a >= 10)
                    {
                        a = int.Parse(a.ToString()[0].ToString()) + int.Parse(a.ToString()[1].ToString());
                    }
                    s2 = s2 + a;
                }
                s = s2;
            }

            return s2;
        }

    }
}
0