QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#717581#6431. Oops, It's Yesterday Twice MorefrogmanWA 0ms3636kbC++14803b2024-11-06 18:23:052024-11-06 18:23:07

Judging History

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

  • [2024-11-06 18:23:07]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3636kb
  • [2024-11-06 18:23:05]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int n,a,b;
	cin>>n>>a>>b;
	if(a<=n/2&&b<=n/2){
		for(int i=1;i<n;++i){
			cout<<"UL";
		}
		for(int i=1;i<a;++i){
			cout<<"R";
		}
		for(int i=1;i<b;++i){
			cout<<"D";
		}
	}
	if(a>n/2&&b<=n/2){
		for(int i=1;i<n;++i){
			cout<<"UR";
		}
		for(int i=1;i<=n-a;++i){
			cout<<"L";
		}
		for(int i=1;i<b;++i){
			cout<<"D";
		}
	}
	if(a<=n/2&&b>n/2){
		for(int i=1;i<n;++i){
			cout<<"LD";
		}
		for(int i=1;i<a;++i){
			cout<<"R";
		}
		for(int i=1;i<=n-b;++i){
			cout<<"U";
		}
	}
	if(a>n/2&&b>n/2){
		for(int i=1;i<n;++i){
			cout<<"RD";
		}
		for(int i=1;i<=n-a;++i){
			cout<<"L";
		}
		for(int i=1;i<=n-b;++i){
			cout<<"U";
		}
	}
}

详细

Test #1:

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

input:

3 3 3

output:

RDRD

result:

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

Test #2:

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

input:

4 3 2

output:

URURURLD

result:

wrong answer Failed