結果

問題 No.232 めぐるはめぐる (2)
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-02-28 23:56:14
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 530 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 58,756 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 18:57:23
合計ジャッジ時間 5,397 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>

using namespace std;

#define TMAX 10000

int main(){

	int T,A,B;
	string AB[TMAX];

	cin>>T>>A>>B;

	for(int i=0;i<T;i++){
		AB[i]="";
		
		if(A==0&&B==0){
			if(T-i==3){
				AB[i++]="<^";
				AB[i++]=">";
				AB[i++]="v";
			}
			else AB[i]+='<',B--;
		}
		else{
			if(A>0) AB[i]+='^',A--;
			else AB[i]+='v',A++;
			if(B>0) AB[i]+='>',B--;
			else AB[i]+='<',B++;
		}
	}

	if(A==0&&B==0){
		cout<<"YES"<<endl;
		for(int i=0;i<T;i++){
			cout<<AB[i]<<endl;
		}
	}
	else cout<<"NO"<<endl;

}
0