제출 #302002

#제출 시각아이디문제언어결과실행 시간메모리
302002Muhammetali카니발 티켓 (IOI20_tickets)C++14
27 / 100
757 ms42616 KiB
#include "tickets.h" #include <bits/stdc++.h> #define mp make_pair #define f first #define s second #define sz(x) (int)(x).size() #define rsz resize #define ins insert #define ft front() #define bk back() #define pf push_front #define pb push_back using namespace std; typedef long long ll; typedef pair<int,int> pi; typedef pair<ll,ll> pl; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; ll find_maximum(int k,vector<vi> x) { int n=sz(x); int m=sz(x[0]); ll sum=0; vpi v; for (int i=0;i<n;i++)sum+=x[i][m-1]; for (int i=0;i<n;i++)v.pb({-x[i][0]-x[i][m-1],i}); sort(v.begin(),v.end()); int g=n/2; int prog[20000]={0}; while(g--) { sum+=v[sz(v)-1].f; prog[v[sz(v)-1].s]++; v.pop_back(); } for (int i=0;i<n;i++) { fill(x[i].begin(),x[i].end(),-1); if (prog[i]==0)x[i][m-1]=0; else x[i][0]=0; } allocate_tickets(x); return sum; }
#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...