# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1099129 | alexander_707070 | Scales (IOI15_scales) | C++14 | 0 ms | 0 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<bits/stdc++.h>
//#include "teams.h"
#define MAXN 1000007
using namespace std;
int n,m;
pair<int,int> p[MAXN];
int k[MAXN];
struct interval{
int l,r,k,e;
int len(){
return r-l+1;
}
};
interval combine(interval a,interval b){
interval c={a.l,b.r,0,0};
if(a.k>a.len())swap(a,b);
if(a.k>a.len() and b.k>b.len()){
c.k=c.len()+1;
c.e=0;
}else if(b.k>b.len()){
c.k=a.k+b.len();
c.e=a.e;
}else{