제출 #384692

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
3846922021-04-02 05:14:32anachorAliens (IOI16_aliens)C++14
4 / 100
2 ms512 KiB
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+7, K = 55;
long long sq(long long z) {
return z*z;
}
long long cost(int l, int r, int *x, int *y, long long c) {
// cout<<l<<" "<<r<<" "<<c<<" "<<y[r]<<" "<<x[l]<<" "<<(y[r] - x[l])*(y[r] - x[l]) + c<<endl;
return sq(y[r] - x[l]) - sq(max(0, y[l-1] - x[l])) + c;
}
typedef pair<long long, long long> PLL;
PLL dp[N];
PLL operator+(PLL a, PLL b) {
return PLL(a.first+b.first, a.second+b.second);
}
long long opt[N];
int x[N], y[N];
PLL check(long long c, int n, int *x, int *y) {
deque<pair<int, int>> dq;
dq.push_back({0, 1});
dp[0] = {0, 0};
for (int i=1; i<=n; i++) {
opt[i] = dq.front().first;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...