QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#711824 | #6431. Oops, It's Yesterday Twice More | tieguodundae | WA | 0ms | 3752kb | C++23 | 931b | 2024-11-05 13:38:13 | 2024-11-05 13:38:13 |
Judging History
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