답안 #302002

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
302002 2020-09-18T11:06:44 Z Muhammetali 카니발 티켓 (IOI20_tickets) C++14
27 / 100
757 ms 42616 KB
#include "tickets.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
ll find_maximum(int k,vector<vi> x)
{
	int n=sz(x);
	int m=sz(x[0]);
	ll sum=0;
	vpi v;
	for (int i=0;i<n;i++)sum+=x[i][m-1];
	for (int i=0;i<n;i++)v.pb({-x[i][0]-x[i][m-1],i});
	sort(v.begin(),v.end());
	int g=n/2;
	int prog[20000]={0};
	while(g--)
	{
		sum+=v[sz(v)-1].f;
		prog[v[sz(v)-1].s]++;
		v.pop_back();
	}
	for (int i=0;i<n;i++)
	{
		fill(x[i].begin(),x[i].end(),-1);
		if (prog[i]==0)x[i][m-1]=0;
		else x[i][0]=0;
	}
	allocate_tickets(x);
	return sum;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 2 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 3 ms 512 KB Output is correct
5 Correct 31 ms 2168 KB Output is correct
6 Correct 757 ms 42616 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB There is no ticket of color 0 on day 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 512 KB There is no ticket of color 0 on day 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB There is no ticket of color 0 on day 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB There is no ticket of color 0 on day 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 512 KB Output is correct
6 Correct 2 ms 768 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 1 ms 384 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 3 ms 512 KB Output is correct
11 Correct 31 ms 2168 KB Output is correct
12 Correct 757 ms 42616 KB Output is correct
13 Incorrect 1 ms 384 KB There is no ticket of color 0 on day 1
14 Halted 0 ms 0 KB -