結果

問題 No.232 めぐるはめぐる (2)
ユーザー kagasankagasan
提出日時 2019-08-24 20:41:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,376 bytes
コンパイル時間 1,535 ms
コンパイル使用メモリ 164,892 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-04 16:05:07
合計ジャッジ時間 4,712 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;};


int main(){

    ll T, A, B;
    cin >> T >> A >> B;
    if(T < A || T < B){
        cout << "NO" << endl;
        return 0;
    }
    if(T == 1 && A == 0 && B == 0){
        cout << "NO" << endl;
        return 0;
    } 
    cout << "YES" << endl;
    ll y = 0, x = 0;
    for(ll i = 0; i < T; i++){
        ll t = T - i;
        if(y == A && x == B){
            cout << "<"<<endl;
            x--;
            continue;
        }
        if(t != 2){
            if(y < A)cout << "^";
            if(x < B)cout << ">";
            cout << endl;
            y++;
            x++;
            continue;
        }
        if(y == A && x + 1 == B){
            cout << "^" << endl;
            cout << "v>" << endl;
            x++;
            i++;
        }
        else if(x == B && y + 1 == A){
            cout << ">" << endl;
            cout << "<^" << endl;
            y++;
            i++;
        }
        else if(y + 1 == A && x + 1 == B){
            cout << "^" << endl;
            cout << ">" << endl;
            i++;
        }
        else{
            if(y < A)cout << "^";
            if(x < B)cout << ">";
            cout << endl;
            y++;
            x++;
        }
    }


    return 0;
}
0