QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#606631#6431. Oops, It's Yesterday Twice MoreS_zhi#WA 0ms3640kbC++14928b2024-10-03 11:05:332024-10-03 11:05:34

Judging History

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

  • [2024-10-03 11:05:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3640kb
  • [2024-10-03 11:05:33]
  • 提交

answer

#include <iostream>
using namespace std ;
int main(){
    int n , a , b ; cin >> n >> a >> b ; 
    /*
        U 
    L      R 
        D
    */
    int ansx = 1 , ansy = 1 ; 
    if((a - 1) + (b - 1) <= n - 1){
        ansx = 1 , ansy = 1 ; 
        for(int i = 1 ; i < n ; i ++ ) cout << "UL" ; 
    }else if((a - 1) + (n - b) <= n - 1){
        ansx = 1 , ansy = n ; 
        for(int i = 1 ; i < n ; i ++ ) cout << "DL" ; 
    }else if((n - a) + (b - 1) <= n - 1){
        ansx = n , ansy = 1 ; 
        for(int i = 1 ; i < n ; i ++ ) cout << "UR" ; 
    }else{
        ansx = n , ansy = n ; 
        for(int i = 1 ; i < n ; i ++ ) cout << "DR" ;
    }
    while(ansx != a){
        if(ansx < a) ansx ++ , cout << "R" ;
        else ansx -- , cout << "L" ; 
    }
    while(ansy != b){
        if(ansy < b) ansy ++ , cout << "D" ; 
        else ansy -- , cout << "U" ; 
    }
    return 0 ; 
}

详细

Test #1:

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

input:

3 3 3

output:

DLDLRR

result:

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

Test #2:

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

input:

4 3 2

output:

ULULULRRD

result:

wrong answer Failed