Submission #301206

#TimeUsernameProblemLanguageResultExecution timeMemory
301206Gurban카니발 티켓 (IOI20_tickets)C++17
11 / 100
3 ms768 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; #define pb push_back #define ss second #define ff first #define sz(a) int(a.size()) #define all(a) a.begin(),a.end() typedef long double ld; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vll; const ll inf = 1e18; const int mod = 1e9+7; //998244353; const int maxn = 1e5+5; const int Xg[4] = {1,0,-1,0}, Yg[4] = {0,1,0,-1}; ll modpw(ll a,ll e) {if(e==0)return 1;ll x=modpw(a*a%mod,e>>1);return e&1?x*a%mod:x;} int n,m; ll ans; vi v; vector<vi> s; ll find_maximum(int k, vector<vi> x) { n = x.size(); m = x[0].size(); s.resize(n); for(int i = 0;i < n;i++) s[i].resize(m); if(m==1){ for(int i = 0;i < n;i++) v.pb(x[i][0]); sort(all(v)); for(int i = 0;i < n;i++) ans += abs(v[n/2]-v[i]),s[i][0]=0; allocate_tickets(s); return ans; } }

Compilation message (stderr)

tickets.cpp: In function 'll find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
#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...