제출 #792106

#제출 시각아이디문제언어결과실행 시간메모리
7921066arenCatfish Farm (IOI22_fish)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <cp/debugger.hpp>
#else
#define debug(...) 42
#endif

#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()

typedef long long int64;
typedef pair<int, int> ii;

int64 max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) {
  int64 res0 = 0, res1 = 0;
  for (int i = 0; i < m; i++) {
    if (x[i] == 0) res0 += w[i];
    else res1 += w[i];
  }
  return max(res0, res1);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<int> x(m), y(m), w(m);
  for (int i = 0; i < m; i++) {
    cin >> x[i] >> y[i] >> w[i];
  }
  cout << max_weights(n, m, x, y, w) << '\n';
  return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cc9MoyEL.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccyjlN1L.o:fish.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status