結果

問題 No.232 めぐるはめぐる (2)
ユーザー takubokudoritakubokudori
提出日時 2017-08-31 00:55:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 1,698 bytes
コンパイル時間 638 ms
コンパイル使用メモリ 87,880 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-10-12 13:47:57
合計ジャッジ時間 2,682 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#define N 1000
#define M 1000000007
#define re(i,n) for(int i=0;i<(n);i++)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define fe(i,n,f) for_each(i,n,f)
#define bw(a,b,c) (((a)<=(b))&&((b)<=(c)))
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int main(void){
	int t,a,b;
	cin>>t>>a>>b;
	if(a==0&&b==0&&t==1)return cout<<"NO"<<endl,0;
	if(t>=max(a,b)){
		cout<<"YES"<<endl;
		int i=0,j=0,k=0;
		if(i==a&&j==b){i++;cout<<"^"<<endl;k++;}
		for(;i<a-1||j<b-1;k++){
				if(i<a-1){i++;cout<<"^";}
				if(j<b-1){j++;cout<<">";}
			cout<<endl;
		}
		for(;k<t-1;k++){
			if(i==a-1&&j==b-1){i++;cout<<"^"<<endl;}
			else if(i==a&&j==b-1){i++;cout<<"^"<<endl;}
			else if(i==a+1&&j==b-1){j++;cout<<">"<<endl;}
			else if(i==a+1&&j==b){j++;cout<<">"<<endl;}
			else if(i==a+1&&j==b+1){i--;cout<<"v"<<endl;}
			else if(i==a&&j==b+1){i--;cout<<"v"<<endl;}
			else if(i==a-1&&j==b+1){j--;cout<<"<"<<endl;}
			else if(i==a-1&&j==b){j--;cout<<"<"<<endl;}
		}
		if(i==a-1&&j==b-1){i++;cout<<"^>"<<endl;}
		else if(i==a&&j==b-1){i++;cout<<">"<<endl;}
		else if(i==a+1&&j==b-1){j++;cout<<">v"<<endl;}
		else if(i==a+1&&j==b){j++;cout<<"v"<<endl;}
		else if(i==a+1&&j==b+1){i--;cout<<"v<"<<endl;}
		else if(i==a&&j==b+1){i--;cout<<"<"<<endl;}
		else if(i==a-1&&j==b+1){j--;cout<<"^<"<<endl;}
		else if(i==a-1&&j==b){j--;cout<<"^"<<endl;}

	}else cout<<"NO"<<endl;
	return 0;
}
0