QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#95094 | #5572. Gridlandia | SEM_PRESSAO_pedroteosousa# | WA | 2ms | 3412kb | C++23 | 1.3kb | 2023-04-09 03:42:10 | 2023-04-09 03:42:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio (0); cin.tie (0);
int n;
void solve () {
cin >> n;
if (n == 1) {
cout << "L\n";
return;
}
if (n == 2) {
cout << "LU\nDR\n";
return;
}
if (n & 1) {
vector a (n, vector<char> (n, '.'));
a[0][0] = 'U';
for (int j = 1; j < n; j++) a[0][j] = 'R';
for (int i = 1; i < n; i++) {
for (int j = 0; j < n; j += 2) a[i][j] = 'D';
}
a[1][0] = a[1][1] = 'L';
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) cout << a[i][j] << " ";
cout << "\n";
}
}
else {
vector a (n, vector<char> (n, '.'));
a[0][0] = 'L';
a[0][1] = 'U';
for (int j = 2; j < n; j++) a[0][j] = 'R';
for (int i = 1; i < n; i++)
for (int j = 1; j < n; j += 2) a[i][j] = 'D';
a[1][0] = a[1][1] = 'R';
for (int i = 3; i < n; i += 2) a[i][0] = 'L';
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) cout << a[i][j] << " ";
cout << "\n";
}
}
}
signed main () {
IOS;
solve ();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3328kb
input:
1
output:
L
result:
ok answer = 1
Test #2:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
2
output:
LU DR
result:
ok answer = 4
Test #3:
score: -100
Wrong Answer
time: 2ms
memory: 3344kb
input:
3
output:
U R R L L D D . D
result:
wrong answer Line [name=Line] equals to "U R R ", doesn't correspond to pattern "[ULDR.]+"