結果

問題 No.232 めぐるはめぐる (2)
ユーザー latte0119latte0119
提出日時 2015-06-27 00:59:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 133 ms / 1,000 ms
コード長 716 bytes
コンパイル時間 1,252 ms
コンパイル使用メモリ 144,644 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-12 13:34:40
合計ジャッジ時間 3,204 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int l[100000],r[100000];
int main(){
    int T,A,B;
    cin>>T>>A>>B;

    if((T==1&&A==0&&B==0)||(T<A||T<B)){
        cout<<"NO"<<endl;
        return 0;
    }

    cout<<"YES"<<endl;

    int cur=0;

    while(A){
        l[cur++]=1;
        A--;
    }

    while(cur+1<T){
        l[cur++]=1;
        l[cur++]=-1;
    }

    cur=0;

    while(B){
        r[cur++]=1;
        B--;
    }

    while(cur+1<T){
        r[cur++]=1;
        r[cur++]=-1;
    }

    reverse(r,r+T);

    for(int i=0;i<T;i++){
        if(l[i]==1)cout<<"^";
        if(l[i]==-1)cout<<"v";
        if(r[i]==1)cout<<">";
        if(r[i]==-1)cout<<"<";
        cout<<endl;
    }

    return 0;
}
0