結果

問題 No.232 めぐるはめぐる (2)
ユーザー takubokudoritakubokudori
提出日時 2017-08-31 00:51:05
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,666 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 88,836 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 07:25:35
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 124 ms
5,376 KB
testcase_02 AC 121 ms
5,376 KB
testcase_03 AC 111 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 91 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 2 ms
5,376 KB
testcase_20 WA -
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 1 ms
5,376 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,j,k=0;
		for(i=0,j=0;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