QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#661176#6431. Oops, It's Yesterday Twice Morezyq_313#WA 0ms3660kbC++14862b2024-10-20 15:01:402024-10-20 15:01:41

Judging History

你现在查看的是最新测评结果

  • [2024-10-20 15:01:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3660kb
  • [2024-10-20 15:01:40]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define pii pair<int, int>


int n, a, b;
int x, y;

void solve(){
	cin >> n >> a >> b;
	if(a<=n-a)x=0;
	else x=1;
	if(b<=n-b)y=0;
	else y=1;
	for(int i=1;i<n;i++){
		if(x==0)cout<<'L';
		else cout<<'R';
	}
	for(int i=1;i<n;i++){
		if(y==0)cout<<'U';
		else cout<<'D';
	}
	if(x==0){
		for(int i=1;i<a;i++){
			cout<<'R';
		}
		if(y==0){
			for(int i=1;i<b;i++){
				cout<<'D';
			}
		}else {
			for(int i=n;i>b;i--){
				cout<<'U';
			}
		}
		
	}else{
		for(int i=n;i>a;i--){
			cout<<'L';
		}
		if(y==0){
			for(int i=1;i<b;i++){
				cout<<'D';
			}
		}else {
			for(int i=n;i>b;i--){
				cout<<'U';
			}
		}
	}
	
}


int main(){
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int t = 1;
//	cin >> t;
	
	while (t --) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3660kb

input:

3 3 3

output:

RRDD

result:

ok n=3, x=3, y=3

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3508kb

input:

4 3 2

output:

RRRUUULD

result:

wrong answer Failed