結果

問題 No.1219 Mancala Combo
ユーザー buey_tbuey_t
提出日時 2023-03-19 12:31:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 1,635 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 118,988 KB
最終ジャッジ日時 2023-10-18 17:44:08
合計ジャッジ時間 5,956 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
84,428 KB
testcase_01 AC 130 ms
84,432 KB
testcase_02 AC 129 ms
84,428 KB
testcase_03 AC 130 ms
84,432 KB
testcase_04 AC 130 ms
84,432 KB
testcase_05 AC 129 ms
84,432 KB
testcase_06 AC 130 ms
84,432 KB
testcase_07 AC 130 ms
84,436 KB
testcase_08 AC 130 ms
84,436 KB
testcase_09 AC 132 ms
84,432 KB
testcase_10 AC 129 ms
84,284 KB
testcase_11 AC 131 ms
84,436 KB
testcase_12 AC 130 ms
84,436 KB
testcase_13 AC 130 ms
84,436 KB
testcase_14 AC 129 ms
84,440 KB
testcase_15 AC 130 ms
84,436 KB
testcase_16 AC 130 ms
84,188 KB
testcase_17 AC 165 ms
108,576 KB
testcase_18 AC 171 ms
109,172 KB
testcase_19 AC 162 ms
106,044 KB
testcase_20 AC 175 ms
111,752 KB
testcase_21 AC 162 ms
103,736 KB
testcase_22 AC 172 ms
106,588 KB
testcase_23 AC 174 ms
114,496 KB
testcase_24 AC 170 ms
104,156 KB
testcase_25 AC 165 ms
105,896 KB
testcase_26 AC 174 ms
109,104 KB
testcase_27 AC 177 ms
118,168 KB
testcase_28 AC 191 ms
118,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    try:
        import pypyjit
        pypyjit.set_param('max_unroll_recursion=-1')
    except:
        pass
    try:
        import sys
        sys.setrecursionlimit(10**7)
    except:
        pass
    from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
    from heapq import heapify, heappop, heappush
    from bisect import bisect_left, bisect_right
    from copy import deepcopy
    import copy
    import random
    from collections import deque,Counter,defaultdict
    from itertools import permutations,combinations
    from decimal import Decimal,ROUND_HALF_UP
    #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    from functools import lru_cache, reduce
    #@lru_cache(maxsize=None)
    from operator import add,sub,mul,xor,and_,or_,itemgetter
    INF = 10**18
    mod1 = 10**9+7
    mod2 = 998244353
    
    #DecimalならPython
    
    
    '''
    回数を増やさないといけない
    %iの値によって
    
    最初から自分より大きい場合は無理
    '''
    
    N = int(input())
    A = list(map(int, input().split()))
    
    f = True
    ad = 0
    end = N
    for i in reversed(range(1,N+1)):
        if A[i-1] == 0 and f:
            continue
        if (A[i-1]+ad)%i != 0 or A[i-1]>i:
            print('No')
            exit()
        ad += (A[i-1]+ad)//i
        f = False
    
    print('Yes')
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0