結果

問題 No.1219 Mancala Combo
ユーザー jensenjensen
提出日時 2021-01-08 11:19:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 30,576 KB
最終ジャッジ日時 2024-04-27 13:19:25
合計ジャッジ時間 3,623 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 31 ms
10,752 KB
testcase_05 AC 31 ms
10,880 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 32 ms
10,752 KB
testcase_08 AC 32 ms
10,752 KB
testcase_09 AC 32 ms
10,752 KB
testcase_10 AC 36 ms
10,752 KB
testcase_11 AC 31 ms
10,880 KB
testcase_12 AC 32 ms
10,880 KB
testcase_13 AC 31 ms
10,880 KB
testcase_14 AC 31 ms
10,880 KB
testcase_15 AC 30 ms
10,752 KB
testcase_16 AC 31 ms
10,880 KB
testcase_17 AC 75 ms
21,272 KB
testcase_18 AC 157 ms
24,696 KB
testcase_19 AC 70 ms
20,152 KB
testcase_20 AC 155 ms
25,232 KB
testcase_21 AC 64 ms
18,856 KB
testcase_22 AC 138 ms
23,328 KB
testcase_23 AC 86 ms
23,444 KB
testcase_24 AC 125 ms
21,496 KB
testcase_25 AC 69 ms
19,792 KB
testcase_26 AC 153 ms
25,440 KB
testcase_27 AC 91 ms
25,276 KB
testcase_28 AC 207 ms
30,576 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