This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Joi.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll
#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2
namespace {
} // namespace
void Joi(int N, int M, int A[], int B[], long long X, int T) {
for (int i=0;i<N;i++)
{
if (i>=60) MessageBoard(i,0);
else if ((1ll<<i)&X) MessageBoard(i,1);
else MessageBoard(i,0);
}
}
#include "Ioi.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e4+7;
const int inf=INT_MAX;
const ll inff=1e18;
const ll mod=1e9+7;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll
#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2
namespace {
int used[maxn];
int ans[maxn];
vector<int> G[maxn];
void dfs(int now)
{
used[now]=1;
for (int i:G[now])
if (!used[i])
{
ans[i]=Move(i);
dfs(i);
Move(now);
}
}
}
long long Ioi(int N, int M, int A[], int B[], int P, int V, int T)
{
for (int i=0;i<M;i++)
G[A[i]].pb(B[i]),G[B[i]].pb(A[i]);
ans[P]=V;
dfs(P);
ll ret=0;
for (int j=0;j<60;j++) ret|=(1ll<<j)*ans[j];
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |