結果

問題 No.232 めぐるはめぐる (2)
ユーザー 184184
提出日時 2015-06-27 20:37:20
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 56,920 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-22 03:19:40
合計ジャッジ時間 2,642 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 AC 8 ms
4,380 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 7 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 6 ms
4,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 WA -
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);
	char vertical[3]="><",horizontal[3]="^v";bool ai=a<0?1:0,bi=b<0?1:0;
	if(a<0)a=-a;if(b<0)b=-b;int mlen=max(a,b);
	if(t<mlen&&(t==1&&!a&&!b)){printf("NO\n");return 0;}
	printf("YES\n");
	int rc=mlen-min(a,b),llen=t-mlen;
	llen/=2;for(int i=0;i<llen;i++)printf(">\n<\n");
	if((t-mlen)%2)printf("%c\n",a<b?horizontal[a?(a-=1,ai):(a+=1,!ai)]:vertical[b?(b--,bi):(b++,!bi)]);
	int nextlen=min(a,b);
	for(int i=0;i<nextlen;i++)printf("%c%c\n",horizontal[ai],vertical[bi]);
	nextlen=mlen-nextlen;char c=a<b?vertical[bi]:horizontal[ai];
	for(int i=0;i<nextlen;i++)printf("%c\n",c);
	return 0;
}
0