結果

問題 No.232 めぐるはめぐる (2)
ユーザー face4face4
提出日時 2018-09-20 18:38:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,181 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 64,632 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-25 10:35:19
合計ジャッジ時間 3,043 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 4 ms
4,384 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 7 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int t, a, b;
    cin >> t >> a >> b;
    if(t < max(a,b)){
        printf("NO\n");
        return 0;
    }

    if( (t-max(a,b))%2 == 0 ){
        printf("YES\n");
        for(int i = 0; i < min(a,b); i++){
            printf(">^\n");
        }
        char c = a > b ? '^' : '>';
        for(int i = 0; i < abs(a-b); i++){
            printf("%c\n", c);
        }
        for(int i = 0; i < (t-max(a,b))/2; i++){
            printf("<\n>\n");
        }
    }else{
        if(t < max(a,b)){
            printf("NO\n");
            return 0;
        }

        printf("YES\n");
        if(a == 0){
            printf("<\n");
            t--;
        }else if(b == 0){
            printf("v\n");
            t--;
        }else{
            printf(">\n^\n");
            t -= 2;
        }

        for(int i = 1; i < min(a,b); i++){
            printf("^>\n");
            t--;
        }

        char c = a > b ? '^' : '>';
        for(int i = 0; i < abs(a-b); i++){
            printf("%c\n", c);
            t--;
        }

        for(int i = 0; i < t/2; i++){
            printf(">\n<\n");
        }
    }

    return 0;
}
0