답안 #723418

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723418 2023-04-13T18:59:58 Z rnl42 Measures (CEOI22_measures) C++14
컴파일 오류
0 ms 0 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 ? '
' : ' ');
  }
}

Compilation message

Main.cpp:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
Main.cpp:8:1: error: extended character   is not valid in an identifier
    8 |  
      | ^
Main.cpp:35:23: warning: missing terminating ' character
   35 |   cout << (i == M-1 ? '
      |                       ^
Main.cpp:35:23: error: missing terminating ' character
Main.cpp:36:1: warning: multi-character character constant [-Wmultichar]
   36 | ' : ' ');
      | ^~~~~
Main.cpp:36:7: warning: missing terminating ' character
   36 | ' : ' ');
      |       ^
Main.cpp:36:7: error: missing terminating ' character
   36 | ' : ' ');
      |       ^~~
Main.cpp:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
Main.cpp:8:1: error: '\U000000a0' does not name a type
    8 |  
      | ^