제출 #1199917

#제출 시각아이디문제언어결과실행 시간메모리
1199917fadyscube메기 농장 (IOI22_fish)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, M; cin >> N >> M; vector<int> X(M), Y(M); vector<ll> W(M); for (int i = 0; i < M; i++) { cin >> X[i] >> Y[i] >> W[i]; } ll sum0 = 0, sum1 = 0; for (int i = 0; i < M; i++) { if (X[i] == 0) sum0 += W[i]; else sum1 += W[i]; } cout << max(sum0, sum1) << "\n"; return 0; }

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

fish.cpp: In function 'int main()':
fish.cpp:3:17: error: template argument 1 is invalid
    3 | #define ll long long;
      |                 ^~~~
fish.cpp:12:12: note: in expansion of macro 'll'
   12 |     vector<ll> W(M);
      |            ^~
fish.cpp:3:17: error: template argument 2 is invalid
    3 | #define ll long long;
      |                 ^~~~
fish.cpp:12:12: note: in expansion of macro 'll'
   12 |     vector<ll> W(M);
      |            ^~
fish.cpp:12:14: error: expected primary-expression before '>' token
   12 |     vector<ll> W(M);
      |              ^
fish.cpp:12:16: error: 'W' was not declared in this scope
   12 |     vector<ll> W(M);
      |                ^
fish.cpp:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
fish.cpp:17:5: note: in expansion of macro 'll'
   17 |     ll sum0 = 0, sum1 = 0;
      |     ^~
fish.cpp:17:8: error: 'sum0' was not declared in this scope
   17 |     ll sum0 = 0, sum1 = 0;
      |        ^~~~
fish.cpp:17:18: error: 'sum1' was not declared in this scope
   17 |     ll sum0 = 0, sum1 = 0;
      |                  ^~~~