제출 #603228

#제출 시각아이디문제언어결과실행 시간메모리
603228Jarif_Rahman카니발 티켓 (IOI20_tickets)C++17
27 / 100
476 ms51616 KiB
#include "tickets.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; ll find_maximum(int k, vector<vector<int>> v){ int n = v.size(), m = v[0].size(); ll ans = 0; for(int i = 0; i < n; i++) ans+=v[i][m-1]; vector<int> s(n); for(int i = 0; i < n; i++) s[i] = i; sort(s.begin(), s.end(), [&](int a, int b){ return v[a][0]+v[a][m-1] < v[b][0]+v[b][m-1]; }); vector<vector<int>> pos(n, vector<int>(m, -1)); for(int i = 0; i < n; i++) pos[i][m-1] = 0; for(int i = 0; i < n/2; i++){ ans-=v[s[i]][0]+v[s[i]][m-1]; swap(pos[s[i]][0], pos[s[i]][m-1]); } allocate_tickets(pos); return ans; }
#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...