#include "tickets.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
ll sum[1505],ans=1e18;
long long find_maximum(int k, std::vector<std::vector<int> > x) {
int n = x.size();
int m = x[0].size();
std::vector<std::vector<int> > answer;
if(m==1){
// subtask 1
for(int i=0; i<n; i++){
sum[i]+=x[i][0];
if(i!=0) sum[i]+=sum[i-1];
}
for(int i=0; i<n; i++){
// x[i][0]
ll cnt=x[i][0]*(i+1)-sum[i];
cnt+=sum[n-1]-sum[i]-(n-i-1)*x[i][0];
ans=min(ans,cnt);
}
answer.resize(n);
for(int i=0; i<n; i++){
answer[i].resize(m);
}
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
answer[i][j]=0;
}
}
allocate_tickets(answer);
return ans;
}
allocate_tickets(answer);
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Contestant returned 1729378519 but the tickets gives a total value of -3832850619 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
296 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 |
288 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 |
204 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 |
204 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 |
204 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 |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Contestant returned 1729378519 but the tickets gives a total value of -3832850619 |
3 |
Halted |
0 ms |
0 KB |
- |