結果

問題 No.432 占い(Easy)
ユーザー NoNo
提出日時 2016-10-14 23:35:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 395 ms / 2,000 ms
コード長 1,262 bytes
コンパイル時間 5,006 ms
コンパイル使用メモリ 106,948 KB
実行使用メモリ 28,944 KB
最終ジャッジ日時 2023-08-14 10:25:54
合計ジャッジ時間 6,137 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,812 KB
testcase_01 AC 54 ms
20,692 KB
testcase_02 AC 56 ms
18,704 KB
testcase_03 AC 58 ms
24,760 KB
testcase_04 AC 58 ms
22,720 KB
testcase_05 AC 56 ms
20,616 KB
testcase_06 AC 55 ms
20,748 KB
testcase_07 AC 59 ms
20,600 KB
testcase_08 AC 55 ms
20,812 KB
testcase_09 AC 57 ms
20,756 KB
testcase_10 AC 59 ms
20,848 KB
testcase_11 AC 88 ms
26,824 KB
testcase_12 AC 388 ms
26,732 KB
testcase_13 AC 395 ms
24,836 KB
testcase_14 AC 86 ms
26,732 KB
testcase_15 AC 55 ms
18,528 KB
testcase_16 AC 56 ms
18,612 KB
testcase_17 AC 286 ms
26,752 KB
testcase_18 AC 215 ms
26,908 KB
testcase_19 AC 161 ms
28,944 KB
testcase_20 AC 101 ms
24,716 KB
testcase_21 AC 108 ms
24,944 KB
testcase_22 AC 57 ms
20,708 KB
testcase_23 AC 57 ms
20,704 KB
testcase_24 AC 58 ms
20,576 KB
testcase_25 AC 57 ms
22,740 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;

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)
        {
            if (s.Length == 1)
            {
                return 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