Submission #380774

#TimeUsernameProblemLanguageResultExecution timeMemory
380774Pichon5Carnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms364 KiB
#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 int #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; vi v; for(int i=0;i<n;i++){ v.pb(x[i][0]); } sort(v.begin(),v.end()); for(int i=0;i<n;i++){ if(i<n/2){ res-=v[i]; }else{ res+=v[i]; } } return res; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:15:6: warning: unused variable 'm' [-Wunused-variable]
   15 |  int m = x[0].size();
      |      ^
#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...