結果

問題 No.432 占い(Easy)
ユーザー jousenjousen
提出日時 2016-10-14 22:46:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 1,369 bytes
コンパイル時間 3,454 ms
コンパイル使用メモリ 107,612 KB
実行使用メモリ 26,916 KB
最終ジャッジ日時 2023-08-14 11:30:30
合計ジャッジ時間 6,812 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
22,820 KB
testcase_01 AC 54 ms
20,736 KB
testcase_02 AC 54 ms
22,772 KB
testcase_03 AC 55 ms
20,724 KB
testcase_04 AC 56 ms
20,632 KB
testcase_05 AC 55 ms
20,636 KB
testcase_06 AC 54 ms
20,760 KB
testcase_07 AC 55 ms
20,828 KB
testcase_08 AC 55 ms
22,772 KB
testcase_09 AC 59 ms
22,928 KB
testcase_10 AC 57 ms
20,732 KB
testcase_11 AC 66 ms
24,860 KB
testcase_12 AC 191 ms
24,916 KB
testcase_13 AC 190 ms
26,852 KB
testcase_14 AC 66 ms
26,792 KB
testcase_15 AC 55 ms
20,756 KB
testcase_16 AC 55 ms
20,716 KB
testcase_17 AC 167 ms
26,904 KB
testcase_18 AC 111 ms
24,800 KB
testcase_19 AC 90 ms
26,916 KB
testcase_20 AC 70 ms
24,816 KB
testcase_21 AC 74 ms
22,784 KB
testcase_22 AC 57 ms
22,772 KB
testcase_23 AC 57 ms
22,800 KB
testcase_24 AC 60 ms
20,700 KB
testcase_25 AC 58 ms
20,724 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.Collections;
using System.Linq;


namespace tes
{
	class contest
	{
				
		
		static void Main(string[] args)
		{

			var n = int.Parse(Console.ReadLine());
            var arr = new string[n];
            for(int i =0; i< n; i++)
            {
                arr[i] = Console.ReadLine();
            }

            var ans = new int[n];
            for(int i =0; i< n; i++)
            {
                if (arr[i].Length > 1) ans[i] = ret(arr[i]);
                else ans[i] = int.Parse(arr[i]);
            }

            foreach(int item in ans)
            {
                Console.WriteLine(item);
                    
            }



			
		}	
		static int ret(string n)
        {
            string tmp = "";
            while(true)
            {
                tmp = "";
                for(int i=0; i<n.Length-1; i++)
                {
                    int t = n[i] - '0' + n[i + 1] - '0';
                    
                    if(t>=10)
                    {
                        string memo = t.ToString();
                        t = (memo[0]-'0') + (memo[1]-'0');
                    }
                    tmp += t.ToString();
                }

                n = tmp;

                if (n.Length == 1) break;
            }

            return int.Parse(n);

        }
			
	}
}
0