結果

問題 No.2101 [Cherry Alpha N] ずっとこの数列だったらいいのに
ユーザー keisuke6keisuke6
提出日時 2022-08-28 18:26:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 458 bytes
コンパイル時間 4,562 ms
コンパイル使用メモリ 216,348 KB
実行使用メモリ 10,848 KB
最終ジャッジ日時 2023-09-08 19:55:10
合計ジャッジ時間 53,014 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 1,178 ms
5,400 KB
testcase_04 AC 4,415 ms
5,468 KB
testcase_05 AC 1,267 ms
4,888 KB
testcase_06 AC 3,603 ms
5,092 KB
testcase_07 AC 4,481 ms
5,656 KB
testcase_08 AC 4,209 ms
5,064 KB
testcase_09 AC 829 ms
4,832 KB
testcase_10 AC 883 ms
4,380 KB
testcase_11 AC 2,459 ms
4,620 KB
testcase_12 AC 2,493 ms
4,616 KB
testcase_13 AC 1,182 ms
4,380 KB
testcase_14 AC 700 ms
4,380 KB
testcase_15 AC 5,646 ms
5,640 KB
testcase_16 AC 2,768 ms
5,996 KB
testcase_17 AC 687 ms
4,380 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
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;
#define int long long
signed 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;
      int ans = 0;
      for(int j=l-1;j<r;j++) ans += max(0ll,min(A[j],A[j]-(d-T[j]+1)));
      cout<<ans<<endl;
  }
}
0