結果

問題 No.230 Splarraay スプラレェーイ
ユーザー るさるさ
提出日時 2018-05-31 19:27:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 540 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,872 KB
実行使用メモリ 12,388 KB
最終ジャッジ日時 2023-09-12 21:03:13
合計ジャッジ時間 8,627 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,388 KB
testcase_01 AC 16 ms
7,804 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 16 ms
7,828 KB
testcase_04 AC 15 ms
7,696 KB
testcase_05 AC 28 ms
8,260 KB
testcase_06 AC 498 ms
8,192 KB
testcase_07 AC 22 ms
7,768 KB
testcase_08 AC 34 ms
7,720 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
q=int(input())
field=[0 for i in range(n)]
bscore=[0,0]
for i in range(q):
    inq=list(map(int,input().split()))
    if inq[0]:
        field[inq[1]:inq[2]+1]=[inq[0] for j in range(inq[1],inq[2]+1)]
    else:
        acnt=sum(map(lambda x:x==1,field[inq[1]:inq[2]+1]))
        bcnt=sum(map(lambda x:x==2,field[inq[1]:inq[2]+1]))
        if acnt!=bcnt:
            bscore[int(acnt<bcnt)]+=max([acnt,bcnt])

asc=bscore[0]+sum(map(lambda x:x==1,field))
bsc=bscore[1]+sum(map(lambda x:x==2,field))
print(str(asc)+" "+str(bsc))
0