QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#203323#5572. GridlandiaAlfehWA 0ms3644kbC++14794b2023-10-06 16:46:452023-10-06 16:46:46

Judging History

This is the latest submission verdict.

  • [2023-10-06 16:46:46]
  • Judged
  • Verdict: WA
  • Time: 0ms
  • Memory: 3644kb
  • [2023-10-06 16:46:45]
  • Submitted

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