結果

問題 No.1219 Mancala Combo
ユーザー bluemeganebluemegane
提出日時 2020-09-05 11:33:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 580 bytes
コンパイル時間 1,004 ms
コンパイル使用メモリ 61,320 KB
実行使用メモリ 38,616 KB
最終ジャッジ日時 2023-08-18 17:32:31
合計ジャッジ時間 5,063 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,864 KB
testcase_01 AC 58 ms
22,876 KB
testcase_02 AC 57 ms
20,864 KB
testcase_03 AC 57 ms
22,784 KB
testcase_04 AC 63 ms
21,004 KB
testcase_05 AC 64 ms
21,028 KB
testcase_06 AC 58 ms
22,724 KB
testcase_07 AC 64 ms
20,952 KB
testcase_08 AC 63 ms
20,984 KB
testcase_09 AC 58 ms
20,744 KB
testcase_10 AC 58 ms
22,800 KB
testcase_11 AC 65 ms
22,932 KB
testcase_12 AC 58 ms
20,868 KB
testcase_13 AC 64 ms
21,028 KB
testcase_14 AC 57 ms
20,728 KB
testcase_15 AC 58 ms
20,832 KB
testcase_16 AC 57 ms
20,752 KB
testcase_17 AC 110 ms
37,512 KB
testcase_18 AC 113 ms
37,832 KB
testcase_19 AC 98 ms
30,028 KB
testcase_20 AC 116 ms
36,048 KB
testcase_21 AC 94 ms
29,404 KB
testcase_22 AC 108 ms
34,700 KB
testcase_23 AC 118 ms
38,616 KB
testcase_24 AC 95 ms
27,564 KB
testcase_25 AC 96 ms
29,840 KB
testcase_26 AC 112 ms
35,728 KB
testcase_27 AC 124 ms
37,580 KB
testcase_28 AC 128 ms
36,388 KB
権限があれば一括ダウンロードができます

ソースコード

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