제출 #500961

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5009612022-01-01 18:19:21IOI_champion_in_1980Hedgehog Daniyar and Algorithms (IZhO19_sortbooks)C++14
100 / 100
1426 ms107364 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long inf = 2000000000;
#define ll long long
#define int long long
#define F first
#define S second
#define pb push_back
int n, m, a[N], l[N], r[N], k[N];
int t[4*N], mx;
bool ans[N];
vector<int> v[N];
void update(int pos, int val, int tl = 1, int tr = n, int v = 1){
if(tl == tr) {
t[v] = max(t[v], val);
}
else{
int tm = (tl + tr) / 2;
if(pos <= tm) update(pos, val, tl, tm, v * 2);
else update(pos, val, tm + 1, tr, v * 2 + 1);
t[v] = max(t[v * 2], t[v * 2 + 1]);
}
}
int get(int v, int tl, int tr, int l, int r){
if(l <= tl && tr <= r) return t[v];
if(l > tr || r < tl) return 0;
int tm = (tl + tr) / 2;
return max(get(v * 2, tl, tm, l, r), get(v * 2 + 1, tm + 1, tr, l, r));
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

sortbooks.cpp:31:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   31 |  main()
      |  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...