QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#711824#6431. Oops, It's Yesterday Twice MoretieguodundaeWA 0ms3752kbC++23931b2024-11-05 13:38:132024-11-05 13:38:13

Judging History

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

  • [2024-11-05 13:38:13]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3752kb
  • [2024-11-05 13:38:13]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long ll;
const int N=1e6+10;
int main()
{
	IOS;
	ll n,a,b;
	cin>>n>>a>>b;
	ll t=(n+1)/2;
	string s;
	if(a<=t)
	{
		for(int i=1;i<n;i++)
			s+="U";
		if(b<=t)//(1,1)
		{
			for(int i=1;i<n;i++)
				s+="L";
			for(int i=1;i<a;i++)
				s+="R";
			for(int i=1;i<b;i++)
				s+="D";
		}
		else//(1,n)
		{
			for(int i=1;i<n;i++)
				s+="R";
			for(int i=1;i<a;i++)
				s+="D";
			for(int i=n;i>b;i--)
				s+="L";
		}
	}
	else
	{
		for(int i=1;i<n;i++)
			s+="D";
		if(b<=t)//(n,1)
		{
			for(int i=1;i<n;i++)
				s+="L";
			for(int i=n;i>a;i--)
				s+="U";
			for(int i=1;i<b;i++)
				s+="R";
		}
		else//(n,n)
		{
			for(int i=1;i<n;i++)
				s+="R";
			for(int i=n;i>a;i--)
				s+="U";
			for(int i=n;i>b;i--)
				s+="L";
		}
	}
	cout<<s<<"\n";
	return 0;
}

详细

Test #1:

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

input:

3 3 3

output:

DDRR

result:

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

Test #2:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

4 3 2

output:

DDDLLLUR

result:

ok n=4, x=3, y=2

Test #3:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

2 1 1

output:

UL

result:

ok n=2, x=1, y=1

Test #4:

score: 0
Accepted
time: 0ms
memory: 3540kb

input:

500 250 250

output:

UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU...

result:

ok n=500, x=250, y=250

Test #5:

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

input:

500 250 249

output:

UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU...

result:

wrong answer Failed