結果
問題 | No.1219 Mancala Combo |
ユーザー |
![]() |
提出日時 | 2020-09-04 21:47:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 152 ms / 2,000 ms |
コード長 | 824 bytes |
コンパイル時間 | 260 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 31,280 KB |
最終ジャッジ日時 | 2024-11-26 12:28:05 |
合計ジャッジ時間 | 3,037 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 |
ソースコード
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()