//#include "gap.h"
//#include "Anthony.h"
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
//#define int long long
#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define modwwe int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task2 "ftree"
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".out","w",stdout)
#define pb push_back
#define mask(k) (1<<k)
#define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms";
using namespace std;
#define getchar_unlocked getchar
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l,int r)
{
return uniform_int_distribution<int>(l,r)(rd);
}
void phongbeo();
const int inf = 1e16;
const ll mod2 = 1e9+7;
const ll base=67;
int n, m, s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center;
int i, s10, s12,k1,k2,k3,s11,lim,w,l,r ;
int kk;
int t;
int el = 19;
vector<int> ans;
vector<int> v[20001];
vector<pair<int,int>> d[20001];
int cost[20001];
vector<int> Mark(int N, int M, int A, int B,
vector<int> U, vector<int> V)
{
n=N;
m=M;
for(int i=0; i<m; i++)
v[U[i]].pb(V[i]),
v[V[i]].pb(U[i]);
memset(cost,-1,sizeof cost);
deque<int>p;
p.pb(0);
cost[0]=0;
while(!p.empty())
{
int x=p.front();
p.pop_front();
for(auto f:v[x])
if(cost[f]==-1)
{
cost[f]=cost[x]+1;
p.pb(f);
}
}
ans.resize(m);
for(int i=0; i<ans.size(); i++)
{
int x=U[i];
int y=V[i];
s2=min(max(cost[x]+1,cost[y]),max(cost[y]+1,cost[x]));
ans[i]=s2%3;
}
return ans;
}
//#include "gap.h"
#include "Catherine.h"
#pragma GCC optimize("Ofast,unroll-loops")
#include<bits/stdc++.h>
//#define int long long
#define ll long long
#define down cout<<'\n';
#define debug cout<<" cucuucucuuu",down
#define modwwe int t;cin>>t; while(t--)
#define bit(i,j) (i>>j&1)
#define sobit(a) __builtin_popcountll(a)
#define task2 "ftree"
#define task "test"
#define fin(x) freopen(x".inp","r",stdin)
#define fou(x) freopen(x".out","w",stdout)
#define pb push_back
#define mask(k) (1<<k)
#define checktime cerr << (double)clock() / CLOCKS_PER_SEC * 1000 << " ms";
using namespace std;
#define getchar_unlocked getchar
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l,int r)
{
return uniform_int_distribution<int>(l,r)(rd);
}
void phongbeo();
const int inf = 1e16;
const ll mod2 = 1e9+7;
const ll base=67;
int n, m, s1, s2, s4, s3, sf, k, s5, s6, mx, s7, s8, s9, mx2, res, dem2 = 0, dem = 0, s33, dem3, dem4, mid, l2, r2, center;
int i, s10, s12,k1,k2,k3,s11,lim,w,l,r ;
int kk;
int t;
int el = 19;
int a,b;
int last=-1;
void Init(int A, int B)
{
a=A;
b=B;
}
int Move(vector<int> y)
{
if(a==2)return 0;
if(last!=-1)
{
last+=3;
last--;
last=last%3;
return last;
}
if(y[0]&&y[1])
{
last=0;
return 0;
}
if(y[1]&&y[2])
{
last=1;
return 1;
}
if(y[2]&&y[0])
{
last=2;
return 2;
}
for(int j=0; j<3; j++)
if(y[j])
{
last=j;
return j;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# 1번째 컴파일 단계
Anthony.cpp:27:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+16' to '2147483647' [-Woverflow]
27 | const int inf = 1e16;
| ^~~~
# 2번째 컴파일 단계
Catherine.cpp:27:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+16' to '2147483647' [-Woverflow]
27 | const int inf = 1e16;
| ^~~~
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:73:1: warning: control reaches end of non-void function [-Wreturn-type]
73 | }
| ^
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |