Submission #588338

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5883382022-07-03 07:40:22sofapudenAliens (IOI16_aliens)C++14
0 / 100
1 ms232 KiB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = (1ll<<50);
const int mxN = 1e5+5;
struct line{
ll a, b;
int cn;
line(ll _a, ll _b, int _cn) : a(_a), b(_b), cn(_cn) {}
line(ll _a, ll _b) : line(_a, _b, 0) {}
ll eval(ll x){if(b == (1ll<<60))return (1ll<<60); return (x-a+1)*(x-a+1)+b;}
};
vector<int> vals;
struct LCT{
vector<line> st;
LCT(int n) : st(4*n,line(0,1ll<<60)) {}
void ins(line f, int l, int r, int p){
if(l > r)return;
int m = (l+r)>>1;
bool lf = st[p].eval(vals[l]) > f.eval(vals[l]);
bool mf = st[p].eval(vals[m]) > f.eval(vals[m]);
if(mf)swap(st[p],f);
if(lf == mf)ins(f,m+1,r,p<<1|1);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...