結果

問題 No.232 めぐるはめぐる (2)
ユーザー purple_jwlpurple_jwl
提出日時 2015-07-05 21:36:05
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,017 bytes
コンパイル時間 1,214 ms
コンパイル使用メモリ 145,160 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-22 06:25:34
合計ジャッジ時間 3,633 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

#define REP(i, x, n) for(int i = x; i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F first
#define S second
#define mp make_pair

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	int t, a, b;
	cin >> t >> a >> b;
	if(min(a, b) + abs(a - b) > t) {
		cout << "NO" << endl;
	}
	else {
		int v = t - min(a, b) - abs(a - b);
		if(v % 2 && min(a, b) == 0) {
			cout << "NO" << endl;
		}
		else {
			cout << "YES" << endl;
			rep(i, min(a, b) - 1) {
				cout << "^>" << endl;
			}
			if(min(a, b) != 0) {
				if(v % 2) {
					cout << "^" << endl;
					cout << ">" << endl;
					v--;
				}
				else {
					cout << "^>" << endl;
				}
			}
			rep(i, abs(a - b)) {
				if(a > b) cout << "^" << endl;
				else cout << ">" << endl;
			}
			rep(i, v) {
				if(i % 2) cout << "<" << endl;
				else cout << ">" << endl;
			}
		}
	}
	
  return 0;
}
0