Submission #1078324

# Submission time Handle Problem Language Result Execution time Memory
1078324 2024-08-27T15:20:01 Z Marco_Escandon Magic Show (APIO24_show) C++17
0 / 100
7 ms 2096 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);
	for(auto i:V)
	{
		v[i.first]++;
		v[i.second]++;
	}
	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(V.back().second==bs.second||V.back().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 6 ms 2096 KB Correct.
2 Correct 4 ms 2080 KB Correct.
3 Correct 6 ms 2092 KB Correct.
4 Incorrect 7 ms 2080 KB Incorrect answer.
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 2096 KB Correct.
2 Correct 4 ms 2080 KB Correct.
3 Correct 6 ms 2092 KB Correct.
4 Incorrect 7 ms 2080 KB Incorrect answer.
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 2096 KB Correct.
2 Correct 4 ms 2080 KB Correct.
3 Correct 6 ms 2092 KB Correct.
4 Incorrect 7 ms 2080 KB Incorrect answer.
5 Halted 0 ms 0 KB -