# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
18648 | mindol | 역사적 조사 (JOI14_historical) | C++14 | 3156 ms | 6768 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;
vector<int> cpr;
int a[100001];
struct Query{ int s,e,index; long long ans; } d[100001];
int sq=316;
bool comp_sqd(Query a,Query b)
{
if(a.s/sq==b.s/sq) return a.e<b.e;
else return a.s<b.s;
}
bool comp_ind(Query a,Query b){ return a.index<b.index; }
long long tree[1<<18]; int base=1<<17;
void add(int place,int value)
{
place+=base-1;
tree[place]+=value;
for(place>>=1;place>=1;place>>=1)
tree[place]=max(tree[place*2],tree[place*2+1]);
}
int main()
{
int n,q;
scanf("%d %d",&n,&q);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]), cpr.push_back(a[i]);
sort(cpr.begin(),cpr.end());
for(int i=1;i<=n;i++)
# | 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... |