# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
155206 | kungfulon | Art Exhibition (JOI18_art) | C++14 | 383 ms | 29180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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));
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |