#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,N) for(ll i=0;i<N;i++)
#define all(A) A.begin(),A.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
#include <vector>
#include "Alice.h"
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
std::vector<std::pair<int,int>> Alice(){
// add your code here
// change below into your code
ll N=5000;
ll X=setN(N);
X--;
vector<ll> x(60);
rep(i,60){
x[i]=X%2;
X/=2;
}
vector<pair<int,int>> ans;
rep(i,60){
ans.push_back({4999,i*2});
ans.push_back({4999,i*2+1});
}
for(ll i=120;i<4999;i++){
ll j=i%60;
ll k=j*2+x[j];
ans.push_back({k,i});
}
rep(i,N-1) ans[i].fi++,ans[i].se++;
return ans;
}
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
const ll mod = 998244353;
#define fi first
#define se second
#define rep(i,N) for(ll i=0;i<N;i++)
#define all(A) A.begin(),A.end()
#define faster ios::sync_with_stdio(false);cin.tie(nullptr)
#include <vector>
#include "Bob.h"
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
long long Bob(std::vector<std::pair<int,int>> V){
// add your code here
ll N=5000;
vector<ll> deg(N,0);
ll M=V.size();
rep(i,M){
deg[V[i].fi-1]++;
deg[V[i].se-1]++;
}
ll ans=0;
ll bit=1;
rep(i,60){
if(deg[i*2]<deg[i*2+1]) ans+=bit;
bit*=2;
}
return ans+1; // change this into your code
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |