結果

問題 No.232 めぐるはめぐる (2)
ユーザー ytftytft
提出日時 2021-03-19 10:29:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 717 bytes
コンパイル時間 1,636 ms
コンパイル使用メモリ 169,164 KB
実行使用メモリ 9,600 KB
最終ジャッジ日時 2024-04-28 22:59:40
合計ジャッジ時間 3,686 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
9,464 KB
testcase_01 AC 142 ms
9,472 KB
testcase_02 AC 137 ms
9,600 KB
testcase_03 AC 140 ms
9,592 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 99 ms
7,808 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 AC 2 ms
5,376 KB
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 2 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
    int T,A,B;
    cin>>T>>A>>B;
    if(A>T || B>T || (A==0 && B==0 && T==1)){
        cout<<"NO"<<endl;
        return 0;
    }
    cout<<"YES"<<endl;
    vector<string> updown(T),rightleft(T);
    for(int i=0;i<T;i++){
        if(A){
            updown[i]="^";
            A--;
        }else{
            updown[i]="v";
            A++;
        }
        if(B){
            rightleft[T-1-i]=">";
            B--;
        }else{
            rightleft[T-1-i]="<";
            B++;
        }
    }
    if(A){
        updown[T-1]="";
    }
    if(B){
        rightleft[0]="";
    }
    for(int i=0;i<T;i++){
        cout<<updown[i]<<rightleft[i]<<endl;
    }
}
0