Submission #9917556
Source Code Expand
Copy
#include <bits/stdc++.h>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define rep(i,N) for(long long i = 0; i < (long long)(N); i++)
#define repr(i,N) for(long long i = (long long)(N) - 1; i >= 0; i--)
#define rep1(i,N) for(long long i = 1; i <= (long long)(N) ; i++)
#define repr1(i,N) for(long long i = (N) ; (long long)(i) > 0 ; i--)
#define each(x,v) for(auto& x : v)
#define all(v) (v).begin(),(v).end()
#define sz(v) ((int)(v).size())
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define in2(N,s,t) rep(i,N){in(s[i] , t[i]);}
#define in3(N,s,t,u) rep(i,N){in(s[i] , t[i] , u[i]);}
using namespace std; void solve();
using ll = long long; template<class T = ll> using V = vector<T>;
using vi = V<int>; using vl = V<>; using vs = V<string>;
using vd = V<double>; using vvi = V< V<int> >; using vvl = V< V<> >;
template<typename T>using heap = priority_queue< T , V<T> , greater<T> >;
constexpr int inf = 1001001001; constexpr ll infLL = (1LL << 61) - 1;
struct IoSetupNya {IoSetupNya() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(7);} } iosetupnya;
template<typename T, typename U> inline bool amin(T &x, U y) { return (y < x) ? (x = y, true) : false; }
template<typename T, typename U> inline bool amax(T &x, U y) { return (x < y) ? (x = y, true) : false; }
template<typename T, typename U> ostream& operator <<(ostream& os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<typename T, typename U> istream& operator >>(istream& is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator <<(ostream& os, const vector<T> &v) { int s = (int)v.size(); rep(i,s) os << (i ? " " : "") << v[i]; return os; }
template<typename T> istream& operator >>(istream& is, vector<T> &v) { for(auto &x : v) is >> x; return is; }
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
template<typename T>void die(T x){out(x); exit(0);}
#ifdef NyaanDebug
#include "NyaanDebug.h"
#define trc(...) do { cerr << #__VA_ARGS__ << " = "; dbg_out(__VA_ARGS__);} while(0)
#define trca(v,N) do { cerr << #v << " = "; array_out(v , N);cout << endl;} while(0)
#else
#define trc(...)
#define trca(...)
int main(){solve();}
#endif
using P = pair<ll,ll>; using vp = V<P>;
constexpr int MOD = /**/ 1000000007; //*/ 998244353;
//////////////////
void solve(){
ini(N);
if(__builtin_popcount(N)==1) die("No");
out("Yes");
vvi g(2*N+1);
g[3].pb(N+1);
for(int i=3;i<=N;i+=2){
g[1].pb(i-1);
g[i-1].pb(i);
g[1].pb(i+N);
g[i+N].pb(i+N-1);
}
if(N%2==0){
int x = N - 1;
int y = N ^ x ^ 1;
g[x + N].pb(N);
g[y].pb(2*N);
}
rep1(i,N*2) each(j,g[i]) out(i,j);
}
Submission Info
Submission Time |
|
Task |
C - Skolem XOR Tree |
User |
Nyaan |
Language |
C++14 (GCC 5.4.1) |
Score |
700 |
Code Size |
3135 Byte |
Status |
AC |
Exec Time |
38 ms |
Memory |
10616 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
700 / 700 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt |
All |
hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, sample_01.txt, sample_02.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt |
Case Name |
Status |
Exec Time |
Memory |
hand_01.txt |
AC |
1 ms |
256 KB |
hand_02.txt |
AC |
1 ms |
256 KB |
hand_03.txt |
AC |
1 ms |
256 KB |
hand_04.txt |
AC |
1 ms |
256 KB |
hand_05.txt |
AC |
1 ms |
256 KB |
hand_06.txt |
AC |
1 ms |
256 KB |
hand_07.txt |
AC |
1 ms |
256 KB |
sample_01.txt |
AC |
1 ms |
256 KB |
sample_02.txt |
AC |
1 ms |
256 KB |
test_01.txt |
AC |
1 ms |
256 KB |
test_02.txt |
AC |
1 ms |
256 KB |
test_03.txt |
AC |
1 ms |
256 KB |
test_04.txt |
AC |
1 ms |
256 KB |
test_05.txt |
AC |
1 ms |
256 KB |
test_06.txt |
AC |
1 ms |
256 KB |
test_07.txt |
AC |
1 ms |
256 KB |
test_08.txt |
AC |
1 ms |
256 KB |
test_09.txt |
AC |
1 ms |
256 KB |
test_10.txt |
AC |
1 ms |
256 KB |
test_11.txt |
AC |
1 ms |
256 KB |
test_12.txt |
AC |
1 ms |
256 KB |
test_13.txt |
AC |
1 ms |
256 KB |
test_14.txt |
AC |
1 ms |
256 KB |
test_15.txt |
AC |
1 ms |
256 KB |
test_16.txt |
AC |
1 ms |
256 KB |
test_17.txt |
AC |
38 ms |
10616 KB |
test_18.txt |
AC |
38 ms |
10616 KB |
test_19.txt |
AC |
38 ms |
10488 KB |
test_20.txt |
AC |
38 ms |
10488 KB |
test_21.txt |
AC |
10 ms |
2560 KB |
test_22.txt |
AC |
3 ms |
896 KB |
test_23.txt |
AC |
9 ms |
2560 KB |
test_24.txt |
AC |
16 ms |
4348 KB |
test_25.txt |
AC |
10 ms |
2688 KB |
test_26.txt |
AC |
16 ms |
4220 KB |
test_27.txt |
AC |
10 ms |
2688 KB |
test_28.txt |
AC |
28 ms |
7800 KB |