結果

問題 No.1219 Mancala Combo
ユーザー buey_tbuey_t
提出日時 2023-03-19 12:31:20
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 274 ms / 2,000 ms
コード長 1,635 bytes
コンパイル時間 223 ms
使用メモリ 120,772 KB
最終ジャッジ日時 2023-03-19 12:31:31
合計ジャッジ時間 8,931 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 213 ms
88,568 KB
testcase_01 AC 246 ms
88,776 KB
testcase_02 AC 217 ms
88,628 KB
testcase_03 AC 213 ms
88,976 KB
testcase_04 AC 209 ms
88,776 KB
testcase_05 AC 208 ms
88,648 KB
testcase_06 AC 206 ms
88,648 KB
testcase_07 AC 240 ms
88,572 KB
testcase_08 AC 204 ms
88,572 KB
testcase_09 AC 207 ms
88,612 KB
testcase_10 AC 213 ms
88,572 KB
testcase_11 AC 207 ms
88,576 KB
testcase_12 AC 203 ms
88,660 KB
testcase_13 AC 231 ms
88,636 KB
testcase_14 AC 218 ms
88,728 KB
testcase_15 AC 216 ms
89,016 KB
testcase_16 AC 209 ms
88,624 KB
testcase_17 AC 241 ms
110,560 KB
testcase_18 AC 246 ms
110,768 KB
testcase_19 AC 274 ms
107,804 KB
testcase_20 AC 246 ms
113,468 KB
testcase_21 AC 234 ms
105,636 KB
testcase_22 AC 253 ms
108,236 KB
testcase_23 AC 254 ms
116,260 KB
testcase_24 AC 252 ms
105,760 KB
testcase_25 AC 254 ms
107,892 KB
testcase_26 AC 251 ms
110,924 KB
testcase_27 AC 247 ms
119,980 KB
testcase_28 AC 257 ms
120,772 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