結果

問題 No.2101 [Cherry Alpha N] ずっとこの数列だったらいいのに
ユーザー keisuke6keisuke6
提出日時 2022-08-28 18:33:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 438 bytes
コンパイル時間 3,212 ms
コンパイル使用メモリ 216,900 KB
実行使用メモリ 9,220 KB
最終ジャッジ日時 2023-09-08 20:00:24
合計ジャッジ時間 99,540 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 597 ms
4,380 KB
testcase_04 AC 2,236 ms
4,384 KB
testcase_05 AC 676 ms
4,380 KB
testcase_06 AC 1,838 ms
4,384 KB
testcase_07 AC 2,194 ms
4,384 KB
testcase_08 AC 2,159 ms
4,384 KB
testcase_09 AC 465 ms
4,388 KB
testcase_10 AC 489 ms
4,380 KB
testcase_11 AC 1,300 ms
4,380 KB
testcase_12 AC 1,336 ms
4,380 KB
testcase_13 AC 662 ms
4,380 KB
testcase_14 AC 538 ms
4,380 KB
testcase_15 AC 2,883 ms
4,384 KB
testcase_16 AC 1,458 ms
4,660 KB
testcase_17 AC 453 ms
4,380 KB
testcase_18 AC 4,180 ms
4,624 KB
testcase_19 AC 4,200 ms
4,736 KB
testcase_20 AC 4,172 ms
4,612 KB
testcase_21 AC 4,200 ms
4,560 KB
testcase_22 AC 4,163 ms
4,568 KB
testcase_23 AC 4,178 ms
4,624 KB
testcase_24 AC 4,129 ms
4,552 KB
testcase_25 AC 4,125 ms
4,720 KB
testcase_26 AC 4,236 ms
4,660 KB
testcase_27 AC 4,269 ms
4,680 KB
testcase_28 AC 4,179 ms
4,664 KB
testcase_29 AC 4,152 ms
4,672 KB
testcase_30 AC 4,253 ms
4,564 KB
testcase_31 AC 4,169 ms
4,604 KB
testcase_32 AC 4,172 ms
4,568 KB
testcase_33 TLE -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<int> A(N),T(N);
  for(int i=0;i<N;i++) cin>>A[i]>>T[i];
  int Q;
  cin>>Q;
  for(int i=0;i<Q;i++){
      int d,l,r;
      cin>>d>>l>>r;
      long long ans = 0;
      for(int j=l-1;j<r;j++) ans += max(0,min(A[j],A[j]-(d-T[j]+1)));
      cout<<ans<<endl;
  }
}
0