結果
| 問題 | 
                            No.933 おまわりさんこいつです
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mame_shibe
                         | 
                    
| 提出日時 | 2019-12-04 23:11:08 | 
| 言語 | C#(csc)  (csc 3.9.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 974 bytes | 
| コンパイル時間 | 939 ms | 
| コンパイル使用メモリ | 114,600 KB | 
| 実行使用メモリ | 75,960 KB | 
| 最終ジャッジ日時 | 2024-12-14 14:15:41 | 
| 合計ジャッジ時間 | 17,587 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 12 RE * 6 TLE * 4 | 
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;
namespace YukiCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve();
        }
        public void Solve()
        {
            int n = int.Parse(ReadLine());
            int[] p = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int k = 1;
            for (int i = 0; i < n; i++)
            {
                k *= p[i];
            }
            
            while (k.ToString().Length != 1)
            {
                int sum = 0;
                for (int i = 0; i < k.ToString().Length; i++)
                {
                    sum += int.Parse(k.ToString()[i].ToString());
                }
                k += sum;
            }
            
            WriteLine(k);
        }
    }
}
            
            
            
        
            
mame_shibe