답안 #723422

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723422 2023-04-13T19:07:12 Z rnl42 Measures (CEOI22_measures) C++14
24 / 100
1500 ms 3436 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long

int N, M, D;
vector<int> A;
int ans = 0;

signed main() {
  ios::sync_with_stdio(false), cout.tie(0), cin.tie(0);
  cin >> N >> M >> D;
  A.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int in;
  for (int i = 0; i < M; i++) {
    cin >> in;
    A.push_back(in);
    sort(A.begin(), A.end());
    int truc = 0;
    int cur = 0;
    int mini = 0;
    for (int i = (int)A.size()-2; i >= 0; i--) {
      int deltamin = D+A[i]-A[i+1];
      if (deltamin >= 0) {
        cur = cur - deltamin;
      } else {
        cur = truc;
      }
      mini = min(cur, mini);
  }
  int ans = abs(mini);
  cout << (ans>>1); if (ans & 1) cout << ".5";
  cout << (i == M-1 ? '\n' : ' ');
  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Correct 2 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 2 ms 340 KB Output is correct
7 Correct 2 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 112 ms 3412 KB Output is correct
10 Correct 167 ms 3432 KB Output is correct
11 Correct 65 ms 3432 KB Output is correct
12 Correct 220 ms 3428 KB Output is correct
13 Correct 48 ms 3432 KB Output is correct
14 Correct 106 ms 3436 KB Output is correct
15 Correct 99 ms 3412 KB Output is correct
16 Correct 47 ms 3404 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1572 ms 640 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1572 ms 640 KB Time limit exceeded
2 Halted 0 ms 0 KB -