結果

問題 No.1219 Mancala Combo
ユーザー donutholedonuthole
提出日時 2020-09-04 21:47:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 824 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 33,012 KB
最終ジャッジ日時 2023-08-17 15:23:11
合計ジャッジ時間 2,872 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
9,244 KB
testcase_01 AC 24 ms
9,268 KB
testcase_02 AC 22 ms
9,244 KB
testcase_03 AC 23 ms
9,192 KB
testcase_04 AC 23 ms
9,132 KB
testcase_05 AC 23 ms
9,196 KB
testcase_06 AC 23 ms
9,236 KB
testcase_07 AC 23 ms
9,240 KB
testcase_08 AC 24 ms
9,204 KB
testcase_09 AC 23 ms
9,244 KB
testcase_10 AC 23 ms
9,192 KB
testcase_11 AC 23 ms
9,280 KB
testcase_12 AC 23 ms
9,248 KB
testcase_13 AC 23 ms
9,244 KB
testcase_14 AC 23 ms
9,316 KB
testcase_15 AC 23 ms
9,120 KB
testcase_16 AC 23 ms
9,228 KB
testcase_17 AC 61 ms
21,324 KB
testcase_18 AC 93 ms
25,088 KB
testcase_19 AC 57 ms
20,020 KB
testcase_20 AC 96 ms
25,712 KB
testcase_21 AC 53 ms
18,324 KB
testcase_22 AC 85 ms
23,412 KB
testcase_23 AC 69 ms
24,740 KB
testcase_24 AC 76 ms
21,492 KB
testcase_25 AC 55 ms
19,204 KB
testcase_26 AC 91 ms
24,808 KB
testcase_27 AC 77 ms
26,616 KB
testcase_28 AC 123 ms
33,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
import collections
import bisect
import itertools
import decimal
import copy

# import numpy as np

# sys.setrecursionlimit(10 ** 6)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===


def main():
    n = ni()
    a = na()

    flg = True
    cnt = 0
    for i in range(len(a) - 1, -1, -1):
        if a[i] <= i + 1 and (a[i] + cnt) % (i + 1) == 0:
            cnt += (a[i] + cnt) // (i + 1)
        else:
            flg = False
            break

    print("Yes" if flg else "No")


if __name__ == '__main__':
    main()
0