結果

問題 No.232 めぐるはめぐる (2)
ユーザー 184184
提出日時 2015-06-27 18:19:59
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,210 bytes
コンパイル時間 363 ms
コンパイル使用メモリ 55,516 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-22 03:15:46
合計ジャッジ時間 2,993 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 5 ms
4,380 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 5 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 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 AC 2 ms
4,380 KB
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 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
4,376 KB
testcase_22 WA -
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#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(len==1){
				if(b<a){
					if(b<=0)printf(">\n");
					else printf("<\n");
					//c--;
					c++;
				}
				else{
					if(a<=0)printf("^\n");
					else printf("v\n");
					/*
					a>0で、
					*/
					r++;
					//r--;
				}
				//len--;
			}
			else{ 
				if(b>0)printf(">\n");
				else printf("<\n");
				if(a>0)printf("^\n");
				else printf("v\n");
				//len-=2;
				r--,c--;
			}
		}  
		//len=max(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