結果

問題 No.1219 Mancala Combo
ユーザー jensenjensen
提出日時 2021-01-08 11:19:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 548 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 30,832 KB
最終ジャッジ日時 2023-08-09 18:34:34
合計ジャッジ時間 4,779 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,832 KB
testcase_01 AC 16 ms
7,836 KB
testcase_02 AC 16 ms
7,868 KB
testcase_03 AC 16 ms
7,800 KB
testcase_04 AC 16 ms
7,804 KB
testcase_05 AC 15 ms
7,836 KB
testcase_06 AC 16 ms
7,728 KB
testcase_07 AC 16 ms
7,808 KB
testcase_08 AC 15 ms
7,808 KB
testcase_09 AC 16 ms
7,804 KB
testcase_10 AC 16 ms
7,936 KB
testcase_11 AC 15 ms
7,796 KB
testcase_12 AC 16 ms
7,808 KB
testcase_13 AC 15 ms
7,756 KB
testcase_14 AC 16 ms
7,728 KB
testcase_15 AC 15 ms
7,872 KB
testcase_16 AC 15 ms
7,800 KB
testcase_17 AC 57 ms
20,116 KB
testcase_18 AC 129 ms
24,384 KB
testcase_19 AC 53 ms
18,864 KB
testcase_20 AC 132 ms
24,776 KB
testcase_21 AC 47 ms
17,616 KB
testcase_22 AC 114 ms
22,660 KB
testcase_23 AC 64 ms
23,572 KB
testcase_24 AC 102 ms
20,352 KB
testcase_25 AC 50 ms
18,160 KB
testcase_26 AC 125 ms
24,040 KB
testcase_27 AC 72 ms
24,768 KB
testcase_28 AC 172 ms
30,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
a=list(map(int,input().split()))
i=0
hantei=1
s=1

##0となる右端の要素を特定
for i in reversed(range(0,n)):
    if(a[i]!=0): break
##0以外の右端の要素で判定
if(a[i]!=i+1):
    print('No')

##0となる右端の要素以外を考える
else:
    for j in reversed(range(0,i)):
        a[j]=a[j]+s
        if(a[j]%(j+1)!=0):
            hantei=0
            break
        s+=a[j]//(j+1)
    if(hantei==1):
        print('Yes')
    else:
        print('No')
0