結果

問題 No.1219 Mancala Combo
ユーザー FromBooskaFromBooska
提出日時 2023-04-19 18:46:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 589 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 103,680 KB
最終ジャッジ日時 2024-04-22 20:52:22
合計ジャッジ時間 3,008 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
52,352 KB
testcase_01 AC 31 ms
51,936 KB
testcase_02 AC 31 ms
51,840 KB
testcase_03 AC 33 ms
51,712 KB
testcase_04 AC 31 ms
52,224 KB
testcase_05 AC 30 ms
52,608 KB
testcase_06 AC 30 ms
52,180 KB
testcase_07 AC 32 ms
51,968 KB
testcase_08 AC 32 ms
51,712 KB
testcase_09 AC 31 ms
52,224 KB
testcase_10 AC 35 ms
52,096 KB
testcase_11 AC 31 ms
51,968 KB
testcase_12 AC 31 ms
52,480 KB
testcase_13 AC 32 ms
51,968 KB
testcase_14 AC 32 ms
51,968 KB
testcase_15 AC 33 ms
51,968 KB
testcase_16 AC 33 ms
51,940 KB
testcase_17 AC 63 ms
89,600 KB
testcase_18 AC 67 ms
90,624 KB
testcase_19 AC 60 ms
86,400 KB
testcase_20 AC 68 ms
93,696 KB
testcase_21 AC 57 ms
83,200 KB
testcase_22 AC 63 ms
86,912 KB
testcase_23 AC 72 ms
97,280 KB
testcase_24 AC 62 ms
83,712 KB
testcase_25 AC 62 ms
86,144 KB
testcase_26 AC 67 ms
90,364 KB
testcase_27 AC 78 ms
102,272 KB
testcase_28 AC 84 ms
103,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# たとえば3のところにある数と、3超でnum=iの個数、の合計が3の倍数であれば消せる
# それがすべての数で満たされるか

N = int(input())
A = [0]+list(map(int, input().split()))

excess_test = False
for i in range(N, 0, -1):
    if A[i] > i:
        excess_test = True
if excess_test == True:
    print('No')
    exit()

multiple_test = True
exact = 0
for i in range(N, 0, -1):
    if (A[i]+exact)%i == 0:
        exact += (A[i]+exact)//i
    else:
        multiple_test = False
if multiple_test == True:
    print('Yes')
else:
    print('No')




0