QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#622139 | #6431. Oops, It's Yesterday Twice More | KXDdesu | WA | 1ms | 3684kb | C++23 | 1.2kb | 2024-10-08 19:59:38 | 2024-10-08 19:59:38 |
Judging History
answer
#include<bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define lowbit(x) ((x) & (-x))
using i64 = long long;
using pii = std::pair<int, int>;
void solve()
{
int n, a, b;
std::cin >> n >> a >> b;
if (a < n - a) {
for (int i = 0; i < n - 1; i ++) {
std::cout << "U";
}
for (int i = 0; i < a; i ++) {
std::cout << "D";
}
}
else {
for (int i = 0; i < n - 1; i ++) {
std::cout << "D";
}
for (int i = 0; i < n - a; i ++) {
std::cout << "U";
}
}
if (b < n - b) {
for (int i = 0; i < n - 1; i ++) {
std::cout << "L";
}
for (int i = 0; i < b; i ++) {
std::cout << "R";
}
}
else {
for (int i = 0; i < n - 1; i ++) {
std::cout << "R";
}
for (int i = 0; i < n - b; i ++) {
std::cout << "L";
}
}
std::cout << "\n";
}
int main()
{
std::cin.tie(nullptr);
std::cout.tie(nullptr);
std::ios::sync_with_stdio(false);
int T = 1;
//std::cin >> T;
while (T --) solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3684kb
input:
3 3 3
output:
DDRR
result:
ok n=3, x=3, y=3
Test #2:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
4 3 2
output:
DDDURRRLL
result:
ok n=4, x=3, y=2
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3684kb
input:
2 1 1
output:
DURL
result:
wrong answer Too long.