# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
13004 | gs14004 | 역사적 조사 (JOI14_historical) | C++98 | 292 ms | 5592 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int B = 300;
int n,q;
int a[100005];
long long buck[350][350];
vector<int> v;
vector<int> show[100005];
inline int range_count(int p, int q, int o){
return (int)(upper_bound(show[o].begin(),show[o].end(),q) - lower_bound(show[o].begin(),show[o].end(),p));
}
void query(){
int p,q;
scanf("%d %d",&p,&q);
if(p/B == q/B){
long long mv = 0;
for (int i=p; i<=q; i++) {
mv = max(mv,1ll * v[a[i]] * range_count(p,q,a[i]));
}
printf("%lld\n",mv);
return;
}
else{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |