Submission #431128

# Submission time Handle Problem Language Result Execution time Memory
431128 2021-06-17T09:52:59 Z A_D Carnival Tickets (IOI20_tickets) C++14
0 / 100
1 ms 204 KB
#include "tickets.h"
#include <bits/stdc++.h>
using namespace std;
long long find_maximum(int k,vector<vector<int>>x){
	vector<vector<int>> ans;
	vector<int> vec;
	for(int i=0;i<x[0].size();i++){
        vec.push_back(0);
	}
	ans.push_back(vec);
	allocate_tickets(ans);
	vec.clear();
	for(int i=0;i<x[0].size();i++){
        vec.push_back(x[0][i]);
	}
	sort(vec.begin(),vec.end());
	int sz=x[0].size();
	long long ann=0;
	for(int i=0;i<sz/2;i++){
        ann-=vec[i];
	}
	for(int i=sz;i<vec.size();i++){
        ann+=vec[i];
	}
	return ann;
}

Compilation message

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:7:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |  for(int i=0;i<x[0].size();i++){
      |              ~^~~~~~~~~~~~
tickets.cpp:13:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |  for(int i=0;i<x[0].size();i++){
      |              ~^~~~~~~~~~~~
tickets.cpp:22:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |  for(int i=sz;i<vec.size();i++){
      |               ~^~~~~~~~~~~
# 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 0 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 0 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 0 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 0 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 -