結果

問題 No.1219 Mancala Combo
ユーザー marroncastlemarroncastle
提出日時 2020-09-04 22:37:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 348 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 10,716 KB
実行使用メモリ 31,060 KB
最終ジャッジ日時 2023-08-17 17:34:40
合計ジャッジ時間 2,301 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 15 ms
7,896 KB
testcase_02 AC 15 ms
7,804 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,804 KB
testcase_06 WA -
testcase_07 AC 15 ms
7,832 KB
testcase_08 WA -
testcase_09 AC 14 ms
7,844 KB
testcase_10 WA -
testcase_11 AC 15 ms
7,804 KB
testcase_12 WA -
testcase_13 AC 15 ms
7,992 KB
testcase_14 AC 15 ms
7,828 KB
testcase_15 AC 15 ms
7,888 KB
testcase_16 WA -
testcase_17 AC 53 ms
20,040 KB
testcase_18 WA -
testcase_19 AC 47 ms
18,912 KB
testcase_20 WA -
testcase_21 AC 43 ms
17,700 KB
testcase_22 WA -
testcase_23 AC 60 ms
22,436 KB
testcase_24 WA -
testcase_25 AC 45 ms
18,216 KB
testcase_26 WA -
testcase_27 AC 68 ms
24,976 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
  N = int(input())
  A = list(map(int, input().split()))
  if N==1:
    return 'Yes'
  end = N-1
  for i in range(N-1,0,-1):
    if A[i]!=0:
      end = i
      break
    if i==1 and A[i]==0:
      return 'Yes'
  for i in range(1,end):
    if A[i]!=i:
      return 'No'
  if A[end]!=end+1:
    return 'No'
  return 'Yes'
print(solve())
0