結果

問題 No.876 Range Compress Query
ユーザー rkato5680rkato5680
提出日時 2020-08-24 10:17:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 362 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 51,932 KB
最終ジャッジ日時 2024-04-24 01:20:34
合計ジャッジ時間 13,033 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 463 ms
44,356 KB
testcase_01 AC 555 ms
44,220 KB
testcase_02 AC 446 ms
43,960 KB
testcase_03 AC 524 ms
44,260 KB
testcase_04 AC 457 ms
44,100 KB
testcase_05 AC 466 ms
44,348 KB
testcase_06 AC 479 ms
44,096 KB
testcase_07 AC 579 ms
44,608 KB
testcase_08 AC 593 ms
44,600 KB
testcase_09 AC 596 ms
44,224 KB
testcase_10 AC 551 ms
43,960 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

N,Q=map(int,input().split())
*a,=map(int,input().split())
a = np.array([0]+a)

def F(x,y):
    if x == y:
        return 1
    else:
        return G(a[x],a[x+1])+F(x+1,y)

def G(x,y):
    return x != y

for i in range(Q):
    *q, = map(int,input().split())
    if q[0]==1:
        a[q[1]:q[2]+1] += q[3]
    else:
        print(F(q[1],q[2]))
0