Submission #957105

# Submission time Handle Problem Language Result Execution time Memory
957105 2024-04-03T02:40:34 Z 12345678 Carnival Tickets (IOI20_tickets) C++17
11 / 100
1 ms 860 KB
#include "tickets.h"
#include <bits/stdc++.h>

using namespace std;

#define ll long long

ll ans;

long long find_maximum(int k, std::vector<std::vector<int>> x) {
	ll n = x.size();
	ll m = x[0].size();
	vector<vector<int>> res(n);
    vector<int> tmp;
    for (int i=0; i<n; i++) res[i].push_back(0), tmp.push_back(x[i][0]);
	allocate_tickets(res);
    sort(tmp.begin(), tmp.end());
    ll md=tmp[tmp.size()/2];
    for (int i=0; i<n; i++) ans+=abs(tmp[i]-md);
	return ans;
}

Compilation message

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:12:5: warning: unused variable 'm' [-Wunused-variable]
   12 |  ll m = x[0].size();
      |     ^
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 860 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB WA in grader: allocate_tickets called with parameter of wrong size
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 600 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 860 KB Output is correct
7 Incorrect 0 ms 348 KB WA in grader: allocate_tickets called with parameter of wrong size
8 Halted 0 ms 0 KB -