結果

問題 No.232 めぐるはめぐる (2)
ユーザー FF256grhyFF256grhy
提出日時 2015-06-27 00:41:04
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 741 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 26,040 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-09-22 02:53:20
合計ジャッジ時間 1,844 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int t, a, b;

int main(void) {
	scanf("%d%d%d", &t, &a, &b);
	if(t < a || t < b || (t == 1 && a == 0 && b == 0)) {
		printf("NO\n");
	} else {
		printf("YES\n");
		
		int am = (t - a) % 2;
		int bm = (t - b) % 2;
		
		if(t == 1) {
			if(a) { printf("^"); }
			if(b) { printf(">"); }
			printf("\n");
			return 0;
		}
		
		if(am && bm) {
			printf("^\n>\n");
		} else {
			printf("^>\n");
			if(am == 0) { printf("%c", a ? '^' : 'v'); }
			if(bm == 0) { printf("%c", b ? '>' : '<'); }
			printf("\n");
		}
		a -= am ? 1 : 2;
		b -= bm ? 1 : 2;
		
		int i;
		for(i = 0; i < t - 2; i++) {
			printf("%c", (a <= i && i % 2) ? 'v' : '^');
			printf("%c", (b <= i && i % 2) ? '<' : '>');
			printf("\n");
		}
	}
	
	return 0;
}
0