結果

問題 No.1219 Mancala Combo
ユーザー bluemeganebluemegane
提出日時 2020-09-05 11:33:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 993 ms
コンパイル使用メモリ 112,476 KB
実行使用メモリ 35,840 KB
最終ジャッジ日時 2024-05-05 22:55:43
合計ジャッジ時間 3,225 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
17,920 KB
testcase_01 AC 23 ms
17,920 KB
testcase_02 AC 22 ms
17,664 KB
testcase_03 AC 23 ms
17,792 KB
testcase_04 AC 27 ms
18,304 KB
testcase_05 AC 27 ms
18,176 KB
testcase_06 AC 23 ms
17,920 KB
testcase_07 AC 27 ms
18,432 KB
testcase_08 AC 27 ms
18,432 KB
testcase_09 AC 22 ms
17,792 KB
testcase_10 AC 22 ms
17,792 KB
testcase_11 AC 26 ms
18,304 KB
testcase_12 AC 23 ms
17,920 KB
testcase_13 AC 26 ms
18,304 KB
testcase_14 AC 23 ms
17,920 KB
testcase_15 AC 22 ms
17,920 KB
testcase_16 AC 21 ms
17,920 KB
testcase_17 AC 65 ms
32,384 KB
testcase_18 AC 70 ms
33,152 KB
testcase_19 AC 56 ms
26,880 KB
testcase_20 AC 77 ms
33,408 KB
testcase_21 AC 56 ms
25,344 KB
testcase_22 AC 67 ms
32,000 KB
testcase_23 AC 74 ms
33,664 KB
testcase_24 AC 56 ms
25,856 KB
testcase_25 AC 55 ms
26,496 KB
testcase_26 AC 70 ms
33,024 KB
testcase_27 AC 81 ms
34,816 KB
testcase_28 AC 84 ms
35,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class Hello
{
    static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, long.Parse);
        getAns(n, a);
    }
    static void getAns(int n, long[] a)
    {
        var t = 0L;
        for (int i = n - 1; i >= 0; i--)
        {
            var s = a[i] + t;
            if (s % (i + 1) == 0) { t += s / (i + 1); continue; }
            else { Console.WriteLine("No"); return; }
        }
        Console.WriteLine("Yes");
    }
}
0