結果

問題 No.232 めぐるはめぐる (2)
ユーザー fiordfiord
提出日時 2015-08-20 00:29:41
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 787 bytes
コンパイル時間 1,285 ms
コンパイル使用メモリ 144,916 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-12 13:41:27
合計ジャッジ時間 3,156 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
	int t,a,b;	cin>>t>>a>>b;
	if(a+b==0){
		if(t==1)	cout<<"NO"<<endl;
		else{
			cout<<"YES"<<endl;
			if(t%2==1){
				cout<<"^\n>v\n<\n";
				t-=3;
			}
			while(t){
				cout<<">\n<\n";
				t-=2;
			}
		}
	}
	else if(t<a||t<b)	cout<<"NO"<<endl;
	else{
		cout<<"YES"<<endl;
		while(a>1&&b>1){
			a--,b--,t--;	cout<<">^"<<endl;
		}
		while(a>1){
			a--,t--;	cout<<"^"<<endl;
		}
		while(b>1){
			b--,t--;	cout<<">"<<endl;
		}
		if(t%2==1){
			if(a*b)	cout<<">^"<<endl;
			else if(a)	cout<<"^"<<endl;
			else if(b)	cout<<">"<<endl;
			t--;
		}
		else{
			if(a*b)	cout<<">\n^"<<endl;
			else if(a)	cout<<">^\n<"<<endl;
			else if(b)	cout<<"^\nv>"<<endl;
			t-=2;
		}
		
		while(t){
			cout<<">\n<"<<endl;
			t-=2;
		}
	}
	return 0;
}
0