結果

問題 No.877 Range ReLU Query
ユーザー ei1333333ei1333333
提出日時 2019-09-06 23:19:12
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 492 bytes
コンパイル時間 3,128 ms
コンパイル使用メモリ 212,668 KB
実行使用メモリ 8,068 KB
最終ジャッジ日時 2023-09-07 05:53:06
合計ジャッジ時間 19,174 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,068 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 827 ms
4,376 KB
testcase_12 AC 696 ms
4,376 KB
testcase_13 AC 473 ms
4,376 KB
testcase_14 AC 472 ms
4,376 KB
testcase_15 AC 995 ms
4,380 KB
testcase_16 AC 1,474 ms
4,380 KB
testcase_17 AC 1,547 ms
4,376 KB
testcase_18 AC 1,542 ms
4,380 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 += max(A[j] - d, 0);
    printf("%lld\n", ret);
  }
}

0