Submission #1752441
Source Code Expand
#include<iostream> #include<cstdio> #include<vector> #include<string> #include<functional> #include<queue> #include <iomanip> #include<map> #include<limits> #include<cmath> #include<algorithm> #include<bitset> #include<utility> #include<complex> #include<cstdlib> #include<set> #include<cctype> #define DBG cerr << '!' << endl; #define REP(i,n) for(int (i) = (0);(i) < (n);++i) #define rep(i,s,g) for(int (i) = (s);(i) < (g);++i) #define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i)) #define PB push_back #define MP make_pair #define FI first #define SE second #define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;} #define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;} #define ALL(v) v.begin(),v.end() using namespace std; typedef long long ll; typedef vector<int> iv; typedef vector<iv> iiv; typedef vector<string> sv; int mp[200010]; bool can[200010]; int main() { int n,x;cin >> n >> x; if(x == 1 || x == 2*n-1)cout << "N0" << endl; else if(n == 2) { cout << "Yes" << endl; REP(i,3)cout << i+1 << endl; } else { cout << "Yes" << endl; mp[n] = x;can[x] = true; mp[n+1] = x+1;can[x+1] = true; mp[n-1] = x-1;can[x-1] = true; if(x > 2) { mp[n+2] = x-2;can[x-2] = true; } else { mp[n-2] = x+2;can[x+2] = true; } int cou = 1; rep(i,1,2*n) { if(mp[i] == 0) { while(can[cou])cou++; cout << cou << endl; can[cou] = true; } else { cout << mp[i] << endl; } } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Median Pyramid Easy |
User | seica |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1655 Byte |
Status | WA |
Exec Time | 312 ms |
Memory | 1792 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 | AC | 1 ms | 256 KB |
0_01.txt | WA | 1 ms | 256 KB |
1_00.txt | WA | 1 ms | 256 KB |
1_01.txt | AC | 1 ms | 256 KB |
1_02.txt | WA | 1 ms | 256 KB |
1_03.txt | WA | 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 | WA | 1 ms | 256 KB |
1_08.txt | WA | 1 ms | 256 KB |
1_09.txt | AC | 312 ms | 1664 KB |
1_10.txt | AC | 307 ms | 1664 KB |
1_11.txt | AC | 305 ms | 1664 KB |
1_12.txt | AC | 308 ms | 1664 KB |
1_13.txt | AC | 310 ms | 1664 KB |
1_14.txt | WA | 1 ms | 256 KB |
1_15.txt | WA | 1 ms | 256 KB |
1_16.txt | AC | 177 ms | 1024 KB |
1_17.txt | AC | 293 ms | 1792 KB |
1_18.txt | AC | 127 ms | 768 KB |
1_19.txt | WA | 1 ms | 256 KB |