Submission #556280

# Submission time Handle Problem Language Result Execution time Memory
556280 2022-05-02T18:20:08 Z Truitadepatates Traffic (IOI10_traffic) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin >> n;
  vector<long long int>  v(n);
  long long int sum = 0;
  for (int i = 0; i < n; i++){
    cin >> v[i];
    sum += v[i];
  }
  long long int a, b;
  for (int i = 0; i < n-1; i++){
    cin >> a >> b;
  }
  long long int ans = sum + 7;
  long long int r = sum;
  long long int l = 0;
  int ans_ = -1;
  for (int i = 0; i < n; i++){
    r -= v[i];
    if (max(l, r) < ans) ans = max(l, r), ans_ = i;
    l += v[i];
  }
  cout << ans_ << endl;
  return 0;
}

Compilation message

/usr/bin/ld: /tmp/cc8ggtcj.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccWHZrJh.o:traffic.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc8ggtcj.o: in function `main':
grader.cpp:(.text.startup+0xe1): undefined reference to `LocateCentre(int, int*, int*, int*)'
collect2: error: ld returned 1 exit status