結果

問題 No.1219 Mancala Combo
ユーザー ntudantuda
提出日時 2021-09-14 22:07:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 108,784 KB
最終ジャッジ日時 2023-09-09 21:11:00
合計ジャッジ時間 5,191 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,104 KB
testcase_01 AC 73 ms
71,044 KB
testcase_02 AC 77 ms
71,268 KB
testcase_03 AC 71 ms
71,268 KB
testcase_04 WA -
testcase_05 AC 73 ms
71,100 KB
testcase_06 WA -
testcase_07 AC 72 ms
71,044 KB
testcase_08 WA -
testcase_09 AC 72 ms
71,112 KB
testcase_10 WA -
testcase_11 AC 74 ms
71,200 KB
testcase_12 WA -
testcase_13 AC 75 ms
71,308 KB
testcase_14 AC 75 ms
71,268 KB
testcase_15 AC 73 ms
71,040 KB
testcase_16 WA -
testcase_17 AC 106 ms
97,540 KB
testcase_18 WA -
testcase_19 AC 102 ms
95,140 KB
testcase_20 WA -
testcase_21 AC 100 ms
92,488 KB
testcase_22 WA -
testcase_23 AC 114 ms
103,832 KB
testcase_24 WA -
testcase_25 AC 100 ms
94,872 KB
testcase_26 WA -
testcase_27 AC 119 ms
107,960 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = [0] + list(map(int,input().split()))
maxN = N + 1
flag = 1
while flag == 1:
    flag = 0
    maxNt = maxN
    for i in reversed(range(1,maxN)):
        if flag == 0:
            if i == 1 and A[i] == 0:
                flag = 2
                break
            elif A[i] == 0:
                dummy = 0
            elif A[i] != i:
                break
            else:
                flag = 1
            maxNt = i + 1
        if flag == 1:
            if A[i] == i:
                if i == 1:
                    A[i] = 0
                elif A[i-1] != i - 1:
                    A[i-1] += 1
                    A[i] = 0

    maxN = maxNt
    if flag == 2:
        break

if flag == 0:
    print("No")
else:
    print("Yes")
0