QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#661153 | #6431. Oops, It's Yesterday Twice More | zyq_313# | WA | 0ms | 3600kb | C++14 | 860b | 2024-10-20 14:57:25 | 2024-10-20 14:57:26 |
Judging History
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: 3556kb
input:
3 3 3
output:
RRDD
result:
ok n=3, x=3, y=3
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3600kb
input:
4 3 2
output:
RRRDDDLUU
result:
wrong answer Failed