QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#168317#6431. Oops, It's Yesterday Twice MorezlxFTH#WA 1ms3660kbC++14736b2023-09-08 09:24:392023-09-08 09:24:39

Judging History

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

  • [2023-09-08 09:24:39]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3660kb
  • [2023-09-08 09:24:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, a, b;
  cin >> n >> a >> b;
  if (2 * (a - 1) <= n) {
    for (int i = 1; i < n; i++) {
      cout << "L";
    }
    for (int i = 1; i < a; i++) {
      cout << "R";
    }
  } else {
    for (int i = 1; i < n; i++) {
      cout << "R";
    }
    for (int i = n; i > a; i--) {
      cout << "L";
    }
  }
  if (2 * (b - 1) <= n) {
    for (int i = 1; i < n; i++) {
      cout << "U";
    }
    for (int i = 1; i < b; i++) {
      cout << "D";
    }
  } else {
    for (int i = 1; i < n; i++) {
      cout << "D";
    }
    for (int i = n; i > b; i--) {
      cout << "U";
    }
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 3 3

output:

RRDD

result:

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

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3636kb

input:

4 3 2

output:

LLLRRUUUD

result:

wrong answer Failed