mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:31:59 +00:00
P1498 南蛮图腾
R44590884
This commit is contained in:
parent
8859e00f07
commit
c8cbda6669
29
Luogu/problem/P1498/P1498.cpp
Normal file
29
Luogu/problem/P1498/P1498.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, a[1030] = {1};
|
||||
|
||||
int main() {
|
||||
cin >> n;
|
||||
for (int i = 0; i < (1 << n); i++) {
|
||||
for (int j = 1; j < (1 << n) - i; ++j) {
|
||||
cout << " ";
|
||||
}
|
||||
for (int j = i; j >= 0; j--) {
|
||||
a[j] ^= a[j - 1];
|
||||
}
|
||||
if (i & 1) {
|
||||
for (int j = 0; j <= i; j += 2) {
|
||||
cout << (a[j] ? "/__\\" : " ");
|
||||
}
|
||||
|
||||
} else {
|
||||
for (int j = 0; j <= i; j++) {
|
||||
cout << (a[j] ? "/\\" : " ");
|
||||
}
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user