結果

問題 No.232 めぐるはめぐる (2)
ユーザー chakkuchakku
提出日時 2015-09-26 04:01:19
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 124 ms / 1,000 ms
コード長 1,221 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 67,964 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 13:41:41
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <string>
#include <climits>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<":"<<x<<endl
const int INF = INT_MAX / 3;

int main(){
	int T, A, B;
	cin >> T >> A >> B;
	if (T < max(A, B)){
		cout << "NO" << endl;
		return 0;
	}
	if (T == 1 && A == 0 && B == 0){
		cout << "NO" << endl;
		return 0;
	}
	cout << "YES" << endl;
	int res = T - max(A, B);
	if (res % 2 == 1){
		if (A == 0 && B == 0){
			cout << ">^" << endl << "<" << endl << "v" << endl;
			T -= 3;
		}else if (A == 0&&B != 0){
			cout << ">^" << endl << "v" << endl;
			B--;
			T--; T--;
		} else if (B == 0 && A != 0){
			cout << ">^" << endl << "<" << endl;
			A--;
			T--; T--;
		} else{
			cout << ">" << endl << "^" << endl;
			A--; B--;
			T--; T--;
		}
	}
	for (int i = 0; i < min(A, B); i++){
		cout << ">^" << endl;
	}
	for (int i = min(A, B); i < T; i++){
		if (i < max(A, B)){
			if (A>B) cout << "^" << endl;
			else cout << ">" << endl;
		} else{
			if (i % 2) cout << "^" << endl;
			else cout << "v" << endl;
		}
	}
	return 0;
}
0