제출 #404668

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4046682021-05-14 19:43:16nikatamlianiHarbingers (CEOI09_harbingers)C++14
60 / 100
196 ms33624 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 1e5+10, oo = 4e18;
vector<pair<int, int>> edges[N];
int p[N], s[N], v[N], sum[N];
ll dp[N], n;
struct line {
int k;
ll b;
line(int _k, ll _b) : k(_k), b(_b) {}
line() : line(0, 4e18) {}
ll f(int x) {
return (ll)k*x + b;
}
};
struct node {
node *L, *R;
line l;
node() : L(NULL), R(NULL), l() {}
} *root;
pair<line*, line> ops[500005];
int timer = 0;
void add_line(int l, int r, line ln, node *&t) {
if(t == NULL) t = new node();
int m = (0LL+l+r)/2;
bool lft = t->l.f(l) < ln.f(l);
bool mid = t->l.f(m) < ln.f(m);
if(lft == mid && !lft) {
line save = t->l;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

harbingers.cpp: In function 'long long int get_min(long long int, long long int, long long int, node*&)':
harbingers.cpp:53:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   53 |  return min({get_min(l, l+r>>1, x, t->L), get_min((l+r>>1)+1, r, x, t->R), t->l.f(x)});
      |                         ~^~
harbingers.cpp:53:53: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   53 |  return min({get_min(l, l+r>>1, x, t->L), get_min((l+r>>1)+1, r, x, t->R), t->l.f(x)});
      |                                                    ~^~
#Verdict Execution timeMemoryGrader output
Fetching results...