結果

問題 No.1765 While Shining
ユーザー notsix4notsix4
提出日時 2021-11-26 23:09:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 415 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 16,544 KB
最終ジャッジ日時 2023-09-12 05:32:02
合計ジャッジ時間 8,699 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
14,896 KB
testcase_01 AC 15 ms
7,860 KB
testcase_02 AC 15 ms
7,820 KB
testcase_03 AC 14 ms
7,908 KB
testcase_04 AC 15 ms
7,848 KB
testcase_05 AC 16 ms
7,864 KB
testcase_06 AC 14 ms
7,856 KB
testcase_07 AC 15 ms
7,852 KB
testcase_08 AC 15 ms
7,784 KB
testcase_09 AC 188 ms
10,652 KB
testcase_10 AC 271 ms
11,256 KB
testcase_11 AC 230 ms
10,756 KB
testcase_12 AC 253 ms
10,920 KB
testcase_13 AC 229 ms
11,248 KB
testcase_14 AC 288 ms
12,120 KB
testcase_15 AC 282 ms
12,144 KB
testcase_16 AC 281 ms
12,212 KB
testcase_17 AC 280 ms
12,084 KB
testcase_18 AC 283 ms
12,100 KB
testcase_19 AC 288 ms
12,120 KB
testcase_20 AC 283 ms
12,100 KB
testcase_21 AC 281 ms
12,044 KB
testcase_22 AC 282 ms
12,224 KB
testcase_23 AC 287 ms
12,048 KB
testcase_24 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=list(map(int,input().split()))
c=0
nl=[]
for i in l:
    if i==1:
        nl.append(0)
    else:
        nl.append(1)
ml=l
d=0
for j in range(n-1):
    for i in range(n-1):
        if l[j+i]==1 and j+i<n-1:
            c+=1
            if c%2==1:
                l=nl
            else:
                l=ml
        else:
            d+=c
            c=0
            l=ml
            break
print(d)
0