Submission #42808

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
428082018-03-04 12:55:45minhtung0404Segments (IZhO18_segments)C++14
0 / 100
2360 ms12536 KiB
//https://oj.uz/problem/view/IZhO18_segments
#include<bits/stdc++.h>
const int N = 2e5 + 5;
const int MAGIC = 447;
using namespace std;
struct segment{
int l, r, id;
};
vector <segment> mv;
set <int> ms;
int n, t, L[N], R[N], ans, cnt;
int l_sort[N], r_sort[N], l_nosort[N], r_nosort[N], p[N], num;
bool ck[N];
int bsearch(int l, int r, int k){
while (l != r){
int mid = (l + r) >> 1;
if (r_nosort[mid] - l_nosort[mid] + 1 >= k) r = mid;
else l = mid + 1;
}
if (r_nosort[l] - l_nosort[l] + 1 < k) return l + 1;
return l;
}
void get_L(int pos, int k){
int Max = (pos / MAGIC + 1) * MAGIC;
for (int i = pos; i < min(Max, cnt); i++) if (r_nosort[pos] < k) ans--;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

segments.cpp: In function 'int main()':
segments.cpp:94:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int i = 0; i < mv.size(); i++){
                               ^
#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...