Submission #1078334

# Submission time Handle Problem Language Result Execution time Memory
1078334 2024-08-27T15:27:23 Z Marco_Escandon Magic Show (APIO24_show) C++17
0 / 100
6 ms 2100 KB
#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
std::vector<std::pair<int,int>> Alice(){
    long long x = setN(5000);
	ll n=5000;
	map<pair<ll,ll>,ll> mapa;
	vector<pair<ll,ll>> temp;
	ll a=x/5000+1;
	ll b=x%5000+1;
	mapa[{a,b}]=1;
	mapa[{b,a}]=1;
	temp.push_back({a,b});
	for(int i=1; i<=n; i++)
	{
		if(i!=a&&i<=n/2&&mapa[{i,a}]==0)
			temp.push_back({i,a});
		if(i!=b&&i>n/2&&mapa[{i,b}]==0)
			temp.push_back({i,b});
		mapa[{i,b}]=1;
		mapa[{i,a}]=1;
		mapa[{a,i}]=1;
		mapa[{b,i}]=1;
	}
    return temp;
}
#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
long long Bob(std::vector<std::pair<int,int>> V){
	vector<ll> v(5001,0);
	pair<ll,ll> a={0,0};
	for(auto i:V)
	{
		v[i.first]++;
		v[i.second]++;
		a=max(max(make_pair(i.first,i.second),make_pair(i.second,i.first)),a);
	}
	pair<ll,ll> bs={0,0};
	for(int i=0; i<5001; i++)
	{
		bs=max(make_pair(v[i],i),bs);
	}
	v[bs.second]=0;
	pair<ll,ll> bs2={0,0};
	for(int i=0; i<5001; i++)
	{
		bs2=max(make_pair(v[i],i),bs2);
	}
	if(bs2.first==0) bs2=bs;
	if(a.second==bs.second||a.first==bs.second)
		swap(bs,bs2);
    return (bs.second-1)*5000+bs2.second-1; // change this into your code
}

# Verdict Execution time Memory Grader output
1 Correct 5 ms 2096 KB Correct.
2 Correct 4 ms 2100 KB Correct.
3 Correct 5 ms 2100 KB Correct.
4 Incorrect 6 ms 2100 KB Incorrect answer.
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2096 KB Correct.
2 Correct 4 ms 2100 KB Correct.
3 Correct 5 ms 2100 KB Correct.
4 Incorrect 6 ms 2100 KB Incorrect answer.
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2096 KB Correct.
2 Correct 4 ms 2100 KB Correct.
3 Correct 5 ms 2100 KB Correct.
4 Incorrect 6 ms 2100 KB Incorrect answer.
5 Halted 0 ms 0 KB -