#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;
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
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |