제출 #317934

#제출 시각아이디문제언어결과실행 시간메모리
317934nickmet2004카니발 티켓 (IOI20_tickets)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define "tickets.h" using namespace std; int cnt[1505]; int n , m ,k; vector<vector<int>>a; int find_maximum(int k , vector<vector<int>> a){ int n = a.size() , m = a[0].size(); /// nk/2 maximums - nk/2 minimums priority_queue<pair<int , int>> pq; int ans = 0; for(int i = 0; i < n; ++i){ for(int j = 0; j < k; ++j) ans += a[i][m - j - 1] ,pq.emplace(-a[i][j] - a[i][m - k + j] , i); } for(int i = 0; i < n * k / 2; ++i){ auto x = pq.top(); pq.pop(); cnt[x.second]++; ans += x.first; } for(int i = 0; i < n; ++i){ int x = 0; for(int j = 0; j < cnt[i]; ++j) a[i][j] = x++; x %= k; for(int j = m - k + cnt[i]; j < m; ++j)a[i][j] = x++; } allocate_tickets(a); return ans; }

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

tickets.cpp:2:9: error: macro names must be identifiers
    2 | #define "tickets.h"
      |         ^~~~~~~~~~~
tickets.cpp: In function 'int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:27:5: error: 'allocate_tickets' was not declared in this scope
   27 |     allocate_tickets(a);
      |     ^~~~~~~~~~~~~~~~