Submission #331625

# Submission time Handle Problem Language Result Execution time Memory
331625 2020-11-29T09:12:30 Z pggp Carnival Tickets (IOI20_tickets) C++14
11 / 100
2 ms 748 KB
#include <bits/stdc++.h>
#include "tickets.h"

using namespace std;

void allocate_tickets(vector < vector < int > > s);

long long find_maximum(int k, vector < vector < int > > x){
	vector < vector < int > > to_allocate;

	vector < int > v;
	for(vector < int > t : x){
		vector < int > a;
		to_allocate.push_back(a);
		for(int i : t){
			to_allocate[to_allocate.size() - 1].push_back(0);
			v.push_back(i);
		}
	}
	allocate_tickets(to_allocate);
	sort(v.begin(), v.end());
	long long ans = 0;
	for (int i = 0; i < v.size(); ++i)
	{
		if(i < v.size() / 2){
			ans -= v[i];
		}
		else{
			ans += v[i];
		}
	}
	return ans;
}

Compilation message

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:23:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for (int i = 0; i < v.size(); ++i)
      |                  ~~^~~~~~~~~~
tickets.cpp:25:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   if(i < v.size() / 2){
      |      ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 748 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 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 364 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 364 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 384 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 384 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 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 2 ms 748 KB Output is correct
7 Incorrect 0 ms 364 KB There is multiple tickets of color 0 on day 0
8 Halted 0 ms 0 KB -