結果

問題 No.432 占い(Easy)
ユーザー NoNo
提出日時 2016-10-14 23:31:49
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,176 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 104,704 KB
実行使用メモリ 22,016 KB
最終ジャッジ日時 2024-05-01 22:50:50
合計ジャッジ時間 3,757 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
17,664 KB
testcase_01 WA -
testcase_02 AC 23 ms
17,408 KB
testcase_03 AC 24 ms
17,920 KB
testcase_04 AC 27 ms
18,816 KB
testcase_05 AC 24 ms
17,664 KB
testcase_06 WA -
testcase_07 AC 27 ms
18,688 KB
testcase_08 AC 24 ms
17,920 KB
testcase_09 WA -
testcase_10 AC 27 ms
18,432 KB
testcase_11 AC 57 ms
21,760 KB
testcase_12 AC 373 ms
21,760 KB
testcase_13 AC 376 ms
21,632 KB
testcase_14 AC 55 ms
21,632 KB
testcase_15 AC 23 ms
17,792 KB
testcase_16 AC 24 ms
17,664 KB
testcase_17 AC 264 ms
21,760 KB
testcase_18 AC 189 ms
21,632 KB
testcase_19 AC 131 ms
21,760 KB
testcase_20 AC 70 ms
22,016 KB
testcase_21 AC 79 ms
21,760 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