제출 #1017726

#제출 시각아이디문제언어결과실행 시간메모리
1017726ZeroCool카니발 티켓 (IOI20_tickets)C++14
11 / 100
24 ms3300 KiB
#include "tickets.h" #include <vector> #include <bits/stdc++.h> using namespace std; #define ar array #define int long long long long find_maximum(signed k, std::vector<std::vector<signed>> A) { int n = A.size(); int m = A[0].size(); vector<vector<signed> > res(n, vector<signed>(m, -1)); int ans = 0; int cnt[n]; priority_queue<ar<int, 2> > pq; for(int i = 0;i < n;i++){ cnt[i] = k - 1; for(int j = 0;j < k;j++)ans -= A[i][j]; pq.push({A[i][k-1] + A[i][m-1], i}); } for(int it = 0;it < n * k / 2;it++){ int x = pq.top()[0]; int i = pq.top()[1]; pq.pop(); ans += x; if(cnt[i] == 0)continue; --cnt[i]; pq.push({A[i][cnt[i]] + A[i][m - k + cnt[i]], i}); } int r = 0; for(int i = 0;i < n;i++){ for(int j = 0;j <= cnt[i];j++)res[i][j] = (r++) % k; int t = r; for(int j = cnt[i] + 1;j < m;j++)res[i][j] = (t++) % k; } allocate_tickets(res); return ans; } #define int signed

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

tickets.cpp:45: warning: "int" redefined
   45 | #define int signed
      | 
tickets.cpp:7: note: this is the location of the previous definition
    7 | #define int long long
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...