結果

問題 No.232 めぐるはめぐる (2)
ユーザー omuomu
提出日時 2015-06-27 00:14:39
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,094 bytes
コンパイル時間 496 ms
コンパイル使用メモリ 71,104 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 02:44:01
合計ジャッジ時間 2,944 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <set>

using namespace std;

#define For(i,a,b) for(int i = (a);i < (b);i++)
#define rep(i,n) For(i,0,n)

const int dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
string dc[8] = { ">", "v", "<", "^", ">^", ">v", "<^", "<v" };

typedef pair<int, int> P;

int main(){

	int t, a, b;
	cin >> t >> a >> b;

	//取りあえず最短時間を出す
	int m = max(a,b);
	
	//最短時間が制限時間より長い場合は無理
	if (t < m){
		cout << "NO" << endl; 
	}
	else{
		if (t < 2 && (t - m) % 2){
			cout << "NO" << endl; return 0;
		}

		cout << "YES" << endl;

		if (t >= 2 && (t - m) % 2){
			cout << ">" << endl;
			cout << "^" << endl;
			t -= 2; a--; b--; m--;
		}
		rep(i, min(a, b)){
			cout << "^>" << endl;
		}
		rep(i, m - min(a, b)){
			if (a > b)cout << "^" << endl;
			else      cout << ">" << endl;
		}

		if (t - m){
			rep(i, (t - m)/2){
				cout << ">" << endl;
				cout << "<" << endl;
			}
		}
	}


	
	

	return 0;
}
0