提出 #6627375


ソースコード 拡げる

// Sample Code
// E Subtask3
// Written by WA_TLE
// Uploaded by Pro_ktmr

#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e17+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
//想定解です
int main(void){
	int n,Q,i;cin>>n>>Q;
	llint x;
	vector<llint>wa(n+1);
	for(i=0;i<n;i++){cin>>x;wa[i+1]=wa[i]+x;}
	while(Q--){
		llint T,L,R;cin>>T>>L>>R;
		cout<<UBI(wa,T-L)-LBI(wa,T-R)<<endl;
	}
	return 0;
}

提出情報

提出日時
問題 E - 最悪の教頭 (Worst Head Teacher)
ユーザ Pro_ktmr
言語 C++14 (GCC 5.4.1)
得点 100
コード長 1924 Byte
結果 AC
実行時間 1652 ms
メモリ 7296 KiB

ジャッジ結果

セット名 Sample 1 Sample 2 Sample 3 Subtask 1 Subtask 2 Subtask 3
得点 / 配点 0 / 0 0 / 0 0 / 0 15 / 15 16 / 16 69 / 69
結果
AC × 1
AC × 1
AC × 1
AC × 10
AC × 6
AC × 21
セット名 テストケース
Sample 1 sample-01.txt
Sample 2 sample-02.txt
Sample 3 sample-03.txt
Subtask 1 sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt
Subtask 2 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt
Subtask 3 sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 03-01.txt, 03-02.txt, 03-03.txt, 03-04.txt
ケース名 結果 実行時間 メモリ
01-01.txt AC 4 ms 256 KiB
01-02.txt AC 4 ms 256 KiB
01-03.txt AC 4 ms 256 KiB
01-04.txt AC 4 ms 256 KiB
01-05.txt AC 4 ms 256 KiB
01-06.txt AC 4 ms 256 KiB
01-07.txt AC 4 ms 256 KiB
01-08.txt AC 4 ms 256 KiB
02-01.txt AC 1555 ms 6016 KiB
02-02.txt AC 1631 ms 7296 KiB
02-03.txt AC 1551 ms 6144 KiB
02-04.txt AC 1652 ms 7296 KiB
02-05.txt AC 1499 ms 5376 KiB
02-06.txt AC 1629 ms 5760 KiB
03-01.txt AC 1595 ms 6656 KiB
03-02.txt AC 1620 ms 6656 KiB
03-03.txt AC 1588 ms 6656 KiB
03-04.txt AC 1605 ms 6656 KiB
sample-01.txt AC 1 ms 256 KiB
sample-02.txt AC 1 ms 256 KiB
sample-03.txt AC 1 ms 256 KiB