제출 #1319072

#제출 시각아이디문제언어결과실행 시간메모리
1319072aaaaaaaaCloud Computing (CEOI18_clo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #defint int long long vector<vector<int>> v; signed main(){ ios::sync_with_stdio(0); cin.tie(nullptr); cout.tie(nullptr); int n, m, cores = 0; cin >> n; for(int i = 0, a, b, c; i < n; ++i){ cin >> a >> b >> c; v.push_back({b, 1, a, c}); cores += a; } cin >> m; for(int i = 0, a, b, c; i < m; ++i){ cin >> a >> b >> c; v.push_back({b, 0, a, c}); cores += a; } sort(all(v)); vector<int> dp(cores + 5, 0); for(int i = 0; i < v.size(); ++i){ vector<int> ndp(cores + 5, 0); for(int j = 0; j <= cores; ++j){ ndp[j] = dp[j]; if(v[i][1] == 0){ if(j + v[i][2] <= cores) ndp[j] = max(ndp[j], (int) dp[j + v[i][2]] - v[i][3]); }else{ if(v[i][2] <= j){ ndp[j] = max(ndp[j], (int) dp[j - v[i][2]] + v[i][3]); } } } swap(dp, ndp); } cout << dp[0] << "\n"; return 0; }

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

clo.cpp:4:2: error: invalid preprocessing directive #defint; did you mean #define?
    4 | #defint int long long
      |  ^~~~~~
      |  define