結果

問題 No.1219 Mancala Combo
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-03-19 13:38:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 82,060 KB
実行使用メモリ 107,008 KB
最終ジャッジ日時 2024-04-29 06:59:23
合計ジャッジ時間 3,326 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
52,352 KB
testcase_01 AC 33 ms
52,096 KB
testcase_02 AC 32 ms
51,584 KB
testcase_03 AC 31 ms
51,584 KB
testcase_04 AC 34 ms
52,352 KB
testcase_05 AC 34 ms
52,096 KB
testcase_06 AC 35 ms
51,968 KB
testcase_07 AC 40 ms
52,096 KB
testcase_08 AC 33 ms
52,480 KB
testcase_09 AC 31 ms
51,968 KB
testcase_10 AC 32 ms
51,712 KB
testcase_11 AC 31 ms
51,712 KB
testcase_12 AC 31 ms
51,968 KB
testcase_13 AC 34 ms
52,480 KB
testcase_14 AC 38 ms
51,584 KB
testcase_15 AC 38 ms
51,456 KB
testcase_16 AC 37 ms
51,712 KB
testcase_17 AC 68 ms
88,576 KB
testcase_18 AC 74 ms
92,544 KB
testcase_19 AC 60 ms
84,608 KB
testcase_20 AC 75 ms
95,104 KB
testcase_21 AC 59 ms
81,920 KB
testcase_22 AC 69 ms
87,936 KB
testcase_23 AC 72 ms
95,616 KB
testcase_24 AC 65 ms
84,560 KB
testcase_25 AC 62 ms
84,352 KB
testcase_26 AC 73 ms
91,904 KB
testcase_27 AC 77 ms
100,992 KB
testcase_28 AC 90 ms
107,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main1(n,a):
  a=[0]+a
  cnt=0
  for i in reversed(range(1,n+1)):
    if a[i]>i:return False
    if a[i]==0 and cnt==0:continue
    if (a[i]+cnt)%i==0:
      cnt+=(a[i]+cnt)//i
    else:
      return False
  return True
if __name__=='__main__':
  n=int(input())
  a=list(map(int,input().split()))
  ret1=main1(n,a)
  print('Yes' if ret1 else 'No')
0