# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1005272 | ErJ | Measures (CEOI22_measures) | C++17 | 88 ms | 12088 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long double
#define vi vector<ll>
#define pp pair<ll, ll>
#define vp vector<pp>
#define vvi vector<vi>
#define inf 1000000000000000
#define rep(i,n) for(int i = 0; i < n; i++)
int main(){
cin.tie(NULL);
ios_base::sync_with_stdio(false);
int n, m;
ll d;
cin >> n >> m >> d;
d *= 2;
vi A(m);
rep(i,m) {
cin >> A[i];
A[i] *= 2;
}
vp dp(m);
dp[0] = {0, A[0]};
for(int i = 1; i < m; i++){
ll pos = A[i] + dp[i - 1].first;
pos = min(pos, dp[i - 1].second + d);
ll plus = (dp[i-1].second + d - pos) / 2;
dp[i] = {dp[i-1].first + plus, pos + plus};
}
rep(i, dp.size()){
cout << dp[i].first / 2 << " ";
}
cout << endl;
}
컴파일 시 표준 에러 (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... |