結果

問題 No.432 占い(Easy)
ユーザー 14番14番
提出日時 2016-11-08 11:41:01
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,541 bytes
コンパイル時間 2,670 ms
コンパイル使用メモリ 104,060 KB
実行使用メモリ 25,900 KB
最終ジャッジ日時 2023-08-16 14:57:01
合計ジャッジ時間 5,833 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
23,564 KB
testcase_01 AC 60 ms
21,792 KB
testcase_02 AC 59 ms
21,648 KB
testcase_03 AC 60 ms
23,648 KB
testcase_04 AC 61 ms
23,904 KB
testcase_05 AC 60 ms
21,632 KB
testcase_06 AC 61 ms
21,684 KB
testcase_07 AC 64 ms
21,584 KB
testcase_08 AC 61 ms
19,580 KB
testcase_09 AC 61 ms
21,656 KB
testcase_10 AC 61 ms
21,768 KB
testcase_11 AC 62 ms
21,784 KB
testcase_12 AC 65 ms
25,900 KB
testcase_13 AC 64 ms
23,660 KB
testcase_14 AC 61 ms
19,668 KB
testcase_15 AC 61 ms
21,744 KB
testcase_16 AC 60 ms
21,640 KB
testcase_17 AC 63 ms
21,760 KB
testcase_18 AC 61 ms
21,608 KB
testcase_19 AC 62 ms
21,600 KB
testcase_20 AC 61 ms
19,804 KB
testcase_21 AC 63 ms
21,760 KB
testcase_22 AC 64 ms
21,640 KB
testcase_23 AC 61 ms
23,732 KB
testcase_24 AC 62 ms
21,604 KB
testcase_25 AC 61 ms
21,772 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.Text;
using System.Collections.Generic;

public class Program
{
    public void Proc() {
        Reader.IsDebug = false;
        int inputCount = int.Parse(Reader.ReadLine());
        StringBuilder ans = new StringBuilder();
        for(int i=0; i<inputCount;i++) {
            int[] arr = Reader.ReadLine().Select(a=>int.Parse(a.ToString())).ToArray();
            while(arr.Length > 1) {
                int[] tmp = new int[arr.Length-1];
                for(int j=0; j<tmp.Length; j++) {
                    int num = arr[j] + arr[j+1];
                    tmp[j] = (num / 10)+(num%10);
                }
                arr = tmp;
            }
            ans.AppendLine(arr[0].ToString());
        }
        Console.Write(ans.ToString());

    }


    public class Reader {
        public static bool IsDebug = true;
        private static System.IO.StringReader SReader;
        private static string InitText = @"



10
3735193991
6406080286
5191117191
9096163630
2612780068
3850187272
6329054969
8747630709
5278943458
4022606808



";
        public static string ReadLine() {
            if(IsDebug) {
                if(SReader == null) {
                    SReader = new System.IO.StringReader(InitText.Trim());
                }
                return SReader.ReadLine();
            } else {
                return Console.ReadLine();
            }
        }

    }
    public static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}
0