# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
291648 | TheLorax | 모임들 (IOI18_meetings) | C++11 | 5568 ms | 7788 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "meetings.h"
#define F first
#define S second
#define SZ(a) ((int)(a).size())
#define PB push_back
#define ALL(a) (a).begin(), (a).end()
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
std::vector<long long> minimum_costs(std::vector<int> h, std::vector<int> l, std::vector<int> r) {
int q = SZ(l), n=SZ(h);
std::vector<long long> c(q,LLONG_MAX);
for(int i=0; i<q; i++){
std::vector<ll> a(r[i]-l[i]+1), b(r[i]-l[i]+1);
std::vector<ii> m;
for(int j=l[i]; j<=r[i]; j++){
int t=1;
a[j-l[i]]=(j>l[i]?a[j-l[i]-1]:0);
while (!m.empty() && m.back().F<=h[j]) {
a[j-l[i]]-=m.back().F*m.back().S;
t+=m.back().S;
m.pop_back();
}
a[j-l[i]]+=h[j]*t;
m.PB({h[j],t});
}
m.clear();
for(int j=r[i]; j>=l[i]; j--){
int t=1;
b[j-l[i]]=(j<r[i]?b[j-l[i]+1]:0);
while (!m.empty() && m.back().F<=h[j]) {
b[j-l[i]]-=m.back().F*m.back().S;
t+=m.back().S;
m.pop_back();
}
b[j-l[i]]+=h[j]*t;
m.PB({h[j],t});
}
for(int j=0; j<r[i]-l[i]+1; j++){
// fprintf(stderr, "%lld %lld\n", a[j], b[j]);
c[i]=min(c[i],a[j]+b[j]-h[j+l[i]]);
}
}
return c;
}
컴파일 시 표준 에러 (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... |