Submission #2123469
Source Code Expand
#include <iostream>
#include <cstdio>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <stdlib.h>
#include <functional>
#include <string>
#include <list>
#include <fstream>
#include <iomanip>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <nmmintrin.h>
#include <chrono>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) ((a) <= (x) && (x) <= (b))
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define MODU 1000000007
#define bitcheck(a,b) ((a >> b) & 1)
#define bitset(a,b) ( a |= (1 << b))
#define bitunset(a,b) (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll gcd(ll a, ll b) {
if (b == 0) return a;
return gcd(b, a%b);
}
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
std::fill((T*)array, (T*)(array + N), val);
}
struct Edge {
int from, to;
};
signed main()
{
int n,x;
cin >> n >> x;
if (x == 2 * n - 1 || x == 1) {
cout << "No" << endl;
return 0;
}
cout << "Yes" << endl;
if (n == 2) {
cout << "1\n2\n3" << endl;
}
else {
if (x == 2 * n - 2) {
vector<int> out;
rep(i, 1, n + 1) {
if (i != x - 2 && i != x - 1 && i != x && i != x + 1)
out.push_back(i);
}
REP(i, (n * 2 - 1 -4)/2) {
cout << out[i] << "\n";
}
cout << x-2 << "\n" << x << "\n" << x + 1 << "\n" << x - 1 << "\n";
rep(i, (n * 2 - 1 - 4) / 2, out.size()) {
cout << out[i] << "\n";
}
}
else {
vector<int> out;
rep(i, 1, n + 1) {
if (i != x + 2 && i != x + 1 && i != x && i != x - 1)
out.push_back(i);
}
REP(i, (n*2-1 - 4) / 2) {
cout << out[i] << "\n";
}
cout << x + 2 << "\n" << x << "\n" << x - 1 << "\n" << x + 1 << "\n";
rep(i, (n * 2 - 1 - 4) / 2, out.size()) {
cout << out[i] << "\n";
}
}
}
return 0;
}
Submission Info
Submission Time |
|
Task |
B - Median Pyramid Easy |
User |
Gear |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2532 Byte |
Status |
WA |
Exec Time |
11 ms |
Memory |
1400 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
0 / 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 |
WA |
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 |
WA |
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 |
WA |
11 ms |
1272 KB |
1_10.txt |
WA |
11 ms |
1272 KB |
1_11.txt |
WA |
11 ms |
1400 KB |
1_12.txt |
WA |
11 ms |
1400 KB |
1_13.txt |
WA |
11 ms |
1400 KB |
1_14.txt |
AC |
1 ms |
256 KB |
1_15.txt |
AC |
1 ms |
256 KB |
1_16.txt |
WA |
7 ms |
892 KB |
1_17.txt |
WA |
10 ms |
1272 KB |
1_18.txt |
WA |
5 ms |
764 KB |
1_19.txt |
AC |
1 ms |
256 KB |