結果

問題 No.877 Range ReLU Query
ユーザー ei1333333ei1333333
提出日時 2019-09-07 01:42:36
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 469 bytes
コンパイル時間 3,381 ms
コンパイル使用メモリ 212,900 KB
実行使用メモリ 11,460 KB
最終ジャッジ日時 2023-09-07 06:21:36
合計ジャッジ時間 16,911 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,972 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 818 ms
4,376 KB
testcase_12 AC 685 ms
4,380 KB
testcase_13 AC 465 ms
4,380 KB
testcase_14 AC 463 ms
4,376 KB
testcase_15 AC 991 ms
4,380 KB
testcase_16 AC 1,473 ms
4,376 KB
testcase_17 AC 1,532 ms
4,376 KB
testcase_18 AC 1,522 ms
4,376 KB
testcase_19 TLE -
testcase_20 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

using namespace std;

using int64 = long long;


int main() {
  int N, Q;
  int A[100000];
  scanf("%d %d", &N, &Q);
  for(int i = 0; i < N; i++) {
    scanf("%d", &A[i]);
  }
  for(int i = 0; i < Q; i++) {
    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    --b;
    int64 ret = 0;
    for(int j = b; j < c; j++) ret += A[j]-d>0?A[j]-d:0;
    printf("%lld\n", ret);
  }
}
0