# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
380801 | Pichon5 | Carnival Tickets (IOI20_tickets) | C++17 | 1 ms | 364 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "tickets.h"
#include<bits/stdc++.h>
#define lcm(a,b) (a/__gcd(a,b))*b
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define F first
#define S second
#define mp make_pair
using namespace std;
long long find_maximum(int k,vector<vi> x) {
int n = x.size();
int m = x[0].size();
ll res=0;
ll sum=0;
vector<vi>M(n,vi(m,-1));
vector<pair<int,int> >v;//sumas , indice
for(int i=0;i<n;i++){
res+=x[i][m-1];
v.pb({x[i][0]+x[i][m-1],i});
}
sort(v.begin(),v.end());
for(int i=0;i<n/2;i++){
res-=v[i].F;
M[v[i].S][0]=0;
}
for(int i=0;i<n/2;i++){
if(M[i][0]==-1)M[i][m-1]=0;
}
allocate_tickets(M);
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |