結果

問題 No.1219 Mancala Combo
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-03-19 13:38:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 2,427 ms
コンパイル使用メモリ 86,416 KB
実行使用メモリ 108,556 KB
最終ジャッジ日時 2023-08-11 14:44:30
合計ジャッジ時間 6,278 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,348 KB
testcase_01 AC 68 ms
71,120 KB
testcase_02 AC 67 ms
71,580 KB
testcase_03 AC 68 ms
71,444 KB
testcase_04 AC 69 ms
71,456 KB
testcase_05 AC 68 ms
71,536 KB
testcase_06 AC 68 ms
71,352 KB
testcase_07 AC 67 ms
71,188 KB
testcase_08 AC 67 ms
71,340 KB
testcase_09 AC 67 ms
71,384 KB
testcase_10 AC 67 ms
71,336 KB
testcase_11 AC 68 ms
71,344 KB
testcase_12 AC 67 ms
71,376 KB
testcase_13 AC 66 ms
71,288 KB
testcase_14 AC 66 ms
71,452 KB
testcase_15 AC 67 ms
71,336 KB
testcase_16 AC 68 ms
71,188 KB
testcase_17 AC 97 ms
96,920 KB
testcase_18 AC 102 ms
98,120 KB
testcase_19 AC 91 ms
94,400 KB
testcase_20 AC 105 ms
100,580 KB
testcase_21 AC 88 ms
92,160 KB
testcase_22 AC 99 ms
95,220 KB
testcase_23 AC 103 ms
103,092 KB
testcase_24 AC 93 ms
92,488 KB
testcase_25 AC 91 ms
94,204 KB
testcase_26 AC 102 ms
97,692 KB
testcase_27 AC 107 ms
106,836 KB
testcase_28 AC 123 ms
108,556 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