Submission #1766448
Source Code Expand
#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<string>
#include<sstream>
#include<cmath>
#include<climits>
#include<algorithm>
#include<bitset>
#include<set>
#include<stack>
#include<queue>
#include<iomanip>
#include<memory.h>
#include<complex>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef tuple<int,int> tii;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
const double PI = M_PI;
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cerr<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
#define DIV int(1e9+7)
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
/* Coding Space*/
vector<bool> used(200002,0);
int main(){
int n,x; cin >> n >> x;
if(x == 1 || x == 2*n-1) {cout << "No" << endl; return 0;}
if(n == 2 && x == 2){cout<<"Yes\n1\n2\n3\n";return 0;}
cout << "Yes" << endl;
vi cent = {x-1,x,x+1,x-2};
if(x == 2)
cent = {x+1,x,x-1,x+2};
rep(i,4) used[cent[i]] = 1;
int index = 1;
rep(i,2*n-4){
//SHOW(used[index],index);
if(i == n-2){
rep(j,4) cout << cent[j] << endl;
continue;
}
if(used[index] == 1){
index++,i--; continue;
}
if(used[index] == 0){
cout << index << endl;
used[index] = 1;
index++;
continue;
}
}
}
Submission Info
Submission Time |
|
Task |
B - Median Pyramid Easy |
User |
cashisu1 |
Language |
C++14 (GCC 5.4.1) |
Score |
400 |
Code Size |
1748 Byte |
Status |
AC |
Exec Time |
319 ms |
Memory |
1536 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
400 / 400 |
Status |
|
|
Set Name |
Test Cases |
Sample |
0_00.txt, 0_01.txt |
All |
0_00.txt, 0_01.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt, 1_15.txt, 1_16.txt, 1_17.txt, 1_18.txt, 1_19.txt |
Case Name |
Status |
Exec Time |
Memory |
0_00.txt |
AC |
1 ms |
256 KB |
0_01.txt |
AC |
1 ms |
256 KB |
1_00.txt |
AC |
1 ms |
256 KB |
1_01.txt |
AC |
1 ms |
256 KB |
1_02.txt |
AC |
1 ms |
256 KB |
1_03.txt |
AC |
1 ms |
256 KB |
1_04.txt |
AC |
1 ms |
256 KB |
1_05.txt |
AC |
1 ms |
256 KB |
1_06.txt |
AC |
1 ms |
256 KB |
1_07.txt |
AC |
1 ms |
256 KB |
1_08.txt |
AC |
1 ms |
256 KB |
1_09.txt |
AC |
309 ms |
1536 KB |
1_10.txt |
AC |
315 ms |
1536 KB |
1_11.txt |
AC |
319 ms |
1536 KB |
1_12.txt |
AC |
318 ms |
1536 KB |
1_13.txt |
AC |
308 ms |
1536 KB |
1_14.txt |
AC |
1 ms |
256 KB |
1_15.txt |
AC |
1 ms |
256 KB |
1_16.txt |
AC |
177 ms |
896 KB |
1_17.txt |
AC |
303 ms |
1536 KB |
1_18.txt |
AC |
130 ms |
768 KB |
1_19.txt |
AC |
1 ms |
256 KB |