# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
766134 | bachhoangxuan | 역사적 조사 (JOI14_historical) | C++17 | 247 ms | 12128 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
#define maxs 325
#define int long long
const int bl=315;
struct que{
int l,r,id;
};
vector<que> query[maxs][maxs];
int n,x[maxn],num[maxn],ans[maxn];
vector<int> p;
void add(int l,int r,int id,int res){
//cout << l << ' ' << r << ' ' << res << '\n';
for(int i=l;i<=r;i++){
if(i%bl==0 && i+bl-1<=r) i+=bl-1;
else{
num[x[i]]++;
res=max(res,num[x[i]]*p[x[i]]);
}
}
for(int i=l;i<=r;i++){
if(i%bl==0 && i+bl-1<=r) i+=bl-1;
else num[x[i]]--;
}
ans[id]=res;
}
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);cout.tie(NULL);
# | 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... |