제출 #155206

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1552062019-09-27 06:30:23kungfulonArt Exhibition (JOI18_art)C++14
100 / 100
383 ms29180 KiB
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a);i <= (b);i++)
#define repd(i,a,b) for(int i = (a);i >= (b);i--)
#define PB push_back
#define F first
#define S second
#define Task ""
using namespace std;
template <class T> T read(T &a){a = 0;char c = cin.get();bool nega = 0;while(!isdigit(c) && c != '-')c = cin.get();if(c == '-')nega = 1,c = cin.get();a = c - 48;c = cin.get();while(isdigit(c))a = a * 10 + c - 48,c = cin.get();if(nega)a = -a;return a;}
template <class T> void writep(T a){if(a > 9)writep(a / 10);cout.put(a % 10 + 48);}
template <class T> void write(T a){if(a < 0)cout.put('-'),a = -a;writep(a);cout.put(' ');}
template <class T> void writeln(T a){write(a);cout.put('\n');}
const int N = 500012;
int n;
pair<long long,long long> a[N];
struct seg
{
long long t[4*N];
#define mid ((l + r)/2)
long long build(int l,int r,int id)
{
if(l == r) return t[id] = a[l].S - a[l].F;
return t[id] = max(build(l,mid,id*2),build(mid+1,r,id*2+1));
}
long long get(int l,int r,int id,int u,int v)
{
if(l > v || r < u) return LLONG_MIN;
if(l >= u && r <= v) return t[id];
return max(get(l,mid,id*2,u,v),get(mid+1,r,id*2+1,u,v));
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...