#include <bits/stdc++.h>
//#include "grader.h"
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define pb push_back
#define mp make_pair
#define f first
#define s second
/*int n = 5, m = 5, K, r[5][5], d[5][5];
void all(int k, int h, vector<vector<char>> &grid){
if(k == n){
k = 0;
h++;
}
if(h == m){
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
r[i][j] = d[i][j] = 0;
}
}
r[0][0] = 1;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(i == n-1 && j == m-1)
continue;
if(grid[i][j] == '.'){
r[i][j+1] += r[i][j];
d[i+1][j] += d[i][j];
} else if(grid[i][j] == 'X'){
r[i][j+1] += r[i][j] + d[i][j];
d[i+1][j] += r[i][j] + d[i][j];
} else if(grid[i][j] == 'r'){
r[i][j+1] += r[i][j] + d[i][j];
} else {
d[i+1][j] += r[i][j] + d[i][j];
}
}
}
int ans = r[n-1][m-1] + d[n-1][m-1];
if(ans > 0){
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++)
cout << grid[i][j] << ' ';
cout << '\n';
}
cout << ans << '\n';
}
} else {
if(k == 0 && h == 0){
grid[k][h] = 'd';
all(k+1, h, grid);
grid[k][h] = 'r';
all(k+1, h, grid);
grid[k][h] = 'X';
all(k+1, h, grid);
}
else if(k == n-1 && h == m-1){
grid[k][h] = '.';
all(k+1, h, grid);
} else if(k == n-1){
grid[k][h] = 'd';
all(k+1, h, grid);
} else if(h == m-1){
grid[k][h] = 'r';
all(k+1, h, grid);
} else {
grid[k][h] = '.';
all(k+1, h, grid);
grid[k][h] = 'd';
all(k+1, h, grid);
grid[k][h] = 'r';
all(k+1, h, grid);
grid[k][h] = 'X';
all(k+1, h, grid);
}
}
}*/
void solve(){
int k;
cin >> k;
char grid[2][k];
for(int i = 0; i < k; i++){
if(i != k-1){
grid[0][i] = 'X';
grid[1][i] = 'r';
} else {
grid[0][i] = 'd';
grid[1][i] = '.';
}
}
cout << 2 << ' ' << k << '\n';
for(int i = 0; i < 2; i++){
for(int j = 0; j < k; j++)
cout << grid[i][j] << ' ';
cout << '\n';
}
}
int main(){
//freopen("input.txt", "r", stdin);
//freopen("test.out", "w", stdout);
ios::sync_with_stdio(0); cin.tie(0);
int t = 1;
//cin >> t;
while(t--){
solve();
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Token "X" doesn't correspond to pattern "[Xrd\.]{3}" |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
33 ms |
65536 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |