# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
96106 | gs14004 | 수열 (APIO14_sequence) | C++17 | 150 ms | 6348 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<lint, int> pi;
const int MAXN = 100005;
struct line{ lint x, y; int cnt, idx; };
struct cht{
vector<line> v;
int p = 0;
void clear(){ v.clear(); p = 0; }
bool bad(line x, line y, line z){
return (llf)(x.y - y.y) / (y.x - x.x) >= (llf)(z.y - y.y) / (y.x - z.x);
}
void add(line l){
if(v.size() > p && v.back().x == l.x){
if(l.y < v.back().y) l = v.back();
v.pop_back();
}
while(v.size() >= p + 2 && bad(v[v.size()-2], v.back(), l)){
v.pop_back();
}
v.push_back(l);
}
tuple<lint, int, int> query(lint x){
while(p + 1 < v.size() && v[p].x * x + v[p].y <= v[p+1].x * x + v[p+1].y) p++;
return make_tuple(v[p].x * x + v[p].y, v[p].cnt, v[p].idx);
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |