結果

問題 No.232 めぐるはめぐる (2)
ユーザー kaffelunkaffelun
提出日時 2017-11-21 15:58:18
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 621 bytes
コンパイル時間 1,280 ms
コンパイル使用メモリ 150,452 KB
実行使用メモリ 8,692 KB
最終ジャッジ日時 2023-08-17 11:47:54
合計ジャッジ時間 5,299 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
7,704 KB
testcase_01 AC 132 ms
8,692 KB
testcase_02 AC 131 ms
7,636 KB
testcase_03 AC 128 ms
8,628 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 RE -
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 97 ms
8,512 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,376 KB
testcase_13 RE -
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 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 1 ms
4,380 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
	int T, A, B;
	cin >> T >> A >> B;
	int n = T - max(A, B); // はみ出す分のチェビシェフ距離
	if(n < 0) {
		cout << "NO" << endl;
		return 0;
	}
	cout << "YES" << endl;
	vector<string> C;
	int p = A - B; string c = p < 0 ? ">" : "^";
	for(int i = 0; i < abs(p); i++) C.push_back(c);
	for(int i = 0; i < min(A,B); i++) C.push_back("^>");
	if(n % 2) {
		*(C.end() - 1) = "^";
		C.push_back(">");
		n--;
	}
	for(int i = 0; i < n / 2; i++) {
		C.push_back("<");
		C.push_back(">");
	}
	for(int i = 0; i < C.size(); i++) cout << C[i] << endl;
	return 0;
}
0