結果

問題 No.232 めぐるはめぐる (2)
ユーザー 夜
提出日時 2021-01-24 17:49:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,224 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 93,224 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-31 02:10:05
合計ジャッジ時間 5,168 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int t, a, b;
	cin >> t >> a >> b;
	if (max(a, b) > t) {
		cout << "NO" << endl;
		return 0;
	}
	cout << "YES" << endl;
	if (a == 0) {
		if (b % 2 != t % 2) {
			cout << "^" << endl;
			cout << "v>" << endl;
			for (int i = 0; i < b - 1; i++) {
				cout << ">" << endl;
			}
		}
		else {
			for (int i = 0; i < b; i++) {
				cout << ">" << endl;
			}
		}
		for (int i = 0; i < (t - b) / 2; i++) {
			cout << "^" << endl;
			cout << "v" << endl;
		}
		return 0;
	}
	if (b == 0) {
		if (a % 2 != t % 2) {
			cout << ">" << endl;
			cout << "^<" << endl;
			for (int i = 0; i < a - 1; i++) {
				cout << "^" << endl;
			}
		}
		else {
			for (int i = 0; i < a; i++) {
				cout << "^" << endl;
			}
		}
		for (int i = 0; i < (t - a) / 2; i++) {
			cout << "^" << endl;
			cout << "v" << endl;
		}
		return 0;
	}
	cout << "YES" << endl;
	if (a < b) {
		if (b % 2 != t % 2) {
			for (int i = 0; i < a - 1; i++) {
				cout << "^>" << endl;
			}
			cout << "^" << endl;
			for (int i = 0; i < b - a + 1; i++) {
				cout << ">" << endl;
			}
			for (int i = 0; i < (t - b) / 2; i++) {
				cout << "^" << endl;
				cout << "v" << endl;
			}
		}
		else {
			for (int i = 0; i < a; i++) {
				cout << "^>" << endl;
			}
			for (int i = 0; i < b - a; i++) {
				cout << ">" << endl;
			}
			for (int i = 0; i < (t - b) / 2; i++) {
				cout << "^" << endl;
				cout << "v" << endl;
			}
		}
	}
	else {
		if (a % 2 != t % 2) {
			for (int i = 0; i < b - 1; i++) {
				cout << "^>" << endl;
			}
			cout << ">" << endl;
			for (int i = 0; i < a - b + 1; i++) {
				cout << "^" << endl;
			}
			for (int i = 0; i < (t - a) / 2; i++) {
				cout << "^" << endl;
				cout << "v" << endl;
			}
		}
		else {
			for (int i = 0; i < b; i++) {
				cout << "^>" << endl;
			}
			for (int i = 0; i < a - b; i++) {
				cout << "^" << endl;
			}
			for (int i = 0; i < (t - a) / 2; i++) {
				cout << "^" << endl;
				cout << "v" << endl;
			}
		}
	}
}
0