結果

問題 No.232 めぐるはめぐる (2)
ユーザー 184184
提出日時 2015-06-26 23:42:10
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 898 bytes
コンパイル時間 1,203 ms
コンパイル使用メモリ 43,008 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-22 01:46:05
合計ジャッジ時間 2,310 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>

using namespace std;

//namaega184
 
int main(){ 
	int t,a,b;scanf("%d%d%d",&t,&a,&b);
	if(t>=max(abs(a),abs(b))&&!(t==1&&!a&&!b)){ 
		int r=abs(a),c=abs(b),rc=min(r,c);
		int len=max(r,c);
		printf("YES\n");
		int llen=t-len;
		llen/=2;
		for(int i=0;i<llen;i++)printf(">\n<\n");
		if((t-len)%2){
			if(b>0)printf(">\n");
			else printf("<\n");
			if(a>0)printf("^\n");
			else printf("v\n");
			len-=2;r--,c--;
		}   
		rc=len-min(r,c);
		for(int i=0;i<rc;i++){
			if(c>r){
				if(b>0)printf(">\n");
				else printf("<\n");
			}
			else{
				if(a>0)printf("^\n");
				else printf("v\n");
			}
		}
		len-=rc;
		for(int i=0;i<len;i++){
			if(a>0&&b>0)printf("^>\n");
			else if(a>0&&b<=0)printf("^<\n");
			else if(a<=0&&b>0)printf("v>\n");
			else if(a<=0&&b<=0)printf("v<\n");
		} 
	} 
	else printf("NO\n");
	return 0;
}
0