結果

問題 No.232 めぐるはめぐる (2)
ユーザー fiordfiord
提出日時 2015-06-26 22:57:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 819 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 52,092 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 01:25:06
合計ジャッジ時間 5,671 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
	int t,a,b;	cin>>t>>a>>b;
	if(t>=a&&t>=b){
		cout<<"YES"<<endl;
		if(a==b){
			while(a>1&&b>1){
				cout<<">^"<<endl;
				a--;	b--;	t--;
			}
			if(t%2==0){
				cout<<">\n^\n";
				t-=2;
			}
			else{
				cout<<">^"<<endl;
				t--;
			}
		}
		else{
			while(a>0&&b>0){
				cout<<">^\n";
				a--;	b--;	t--;
			}
			if(a>0){
				while(a>1){
					cout<<">"<<endl;
					a--;	t--;
				}
				if(t%2==0){
					cout<<">^\nv\n";
					t-=2;
				}
				else{
					cout<<">"<<endl;
					t--;
				}
			}
			else if(b>0){
				while(b>1){
					cout<<"^"<<endl;
					a--;	t--;
				}
				if(t%2==0){
					cout<<">^\n<\n";
					t-=2;
				}
				else{
					cout<<"^"<<endl;
					t--;
				}
			}
		}
		while(t>0){
			cout<<">\n<\n";
			t--;
		}
	}
	else 	cout<<"NO"<<endl;
	return 0;
}
	
0