# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
723376 | abouton | Measures (CEOI22_measures) | C++17 | 1533 ms | 316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int N, M, D;
vector<int> pos;
signed main()
{
scanf("%lld%lld%lld", &N, &M, &D);
for (int i = 0; i < N; i ++)
{
int a;
scanf("%lld", &a);
pos.push_back(a);
}
for (int x = 0; x < M; x ++)
{
int a; scanf("%lld", &a);
int cur = pos.size()-1;
pos.push_back(0);
while (cur >= 0 && pos[cur] > a)
{
pos[cur+1] = pos[cur];
cur --;
}
cur++;
pos[cur]=a;
int maxi = 0;
for (int i = 0; i < (int)pos.size(); i ++)
{
for (int j = i+1; j < (int)pos.size(); j ++)
{
maxi = max(maxi, (j-i)*D - (pos[j]-pos[i]));
}
}
if (maxi%2==1) cout << (maxi-1)/2 << ".5 ";
else cout << maxi/2 << ' ';
//for( int i = 0; i < pos.size(); i ++) printf("%d ", pos[i]);
//printf("\n");
}
}
컴파일 시 표준 에러 (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... |