QOJ.ac
QOJ
The 2nd Universal Cup Finals is coming! Check out our event page, schedule, and competition rules!
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#203323 | #5572. Gridlandia | Alfeh | WA | 0ms | 3644kb | C++14 | 794b | 2023-10-06 16:46:45 | 2023-10-06 16:46:46 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
const int sz = 1e3 + 5, mod = 998244353;
int vis[sz][sz];
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
for(int i = 1; i <= n; i++) {
string d(n, '.');
for(int j = 1; j <= n; j++) {
if(!vis[i][j - 1] && !vis[i - 1][j - 1]) {
vis[i][j - 1] = vis[i - 1][j - 1] = 1;
d[j- 1] = 'L';
} else if(!vis[i - 1][j - 1] && !vis[i - 1][j]) {
vis[i - 1][j - 1] = vis[i - 1][j] = 1;
d[j- 1] = 'U';
} else if(!vis[i - 1][j] && !vis[i][j]) {
vis[i - 1][j] = vis[i][j] = 1;
d[j- 1] = 'R';
} else if(!vis[i][j] && !vis[i][j - 1]) {
vis[i][j] = vis[i][j - 1] = 1;
d[j- 1] = 'D';
}
}
cout << d << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3644kb
input:
1
output:
L
result:
ok answer = 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
2
output:
LL DR
result:
ok answer = 4
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3592kb
input:
3
output:
LLL D.R DR.
result:
wrong answer jury has the better answer: jans = 8, pans = 7