# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
457925 | 2021-08-07T14:40:41 Z | mario05092929 | Carnival Tickets (IOI20_tickets) | C++17 | 2 ms | 588 KB |
#include "tickets.h" #include <bits/stdc++.h> #define x first #define y second #define pb push_back #define mp make_pair #define all(v) v.begin(),v.end() #pragma gcc optimize("O3") #pragma gcc optimize("Ofast") #pragma gcc optimize("unroll-loops") using namespace std; const int INF = 1e9; const int TMX = 1 << 18; const long long llINF = 1e18; const long long mod = 1e9+7; const long long hashmod = 100003; typedef long long ll; typedef long double ld; typedef pair <int,int> pi; typedef pair <ll,ll> pl; typedef vector <int> vec; typedef vector <pi> vecpi; typedef long long ll; int n,m; ll find_maximum(int k,vector <vec> a) { n = a.size(); m = a[0].size(); vector <vec> ans2; ans2.resize(n); for(int i = 0;i < n;i++) { ans2[i].resize(m); ans2[i][0] = 0; } allocate_tickets(ans2); vec v; for(int i = 0;i < n;i++) { v.pb(a[i][0]); } sort(all(v)); int mid = v[v.size()/2]; ll ans = 0; for(int i = 0;i < n;i++) ans += abs(v[i]-mid); return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 2 ms | 588 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 0 ms | 204 KB | Output is correct |
4 | Correct | 0 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 2 ms | 588 KB | Output is correct |
7 | Incorrect | 1 ms | 204 KB | There is multiple tickets of color 0 on day 0 |
8 | Halted | 0 ms | 0 KB | - |