結果

問題 No.232 めぐるはめぐる (2)
ユーザー 37kt_37kt_
提出日時 2015-09-10 19:29:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 6 ms / 1,000 ms
コード長 1,359 bytes
コンパイル時間 1,783 ms
コンパイル使用メモリ 146,780 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-12 13:41:38
合計ジャッジ時間 2,630 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// BCC
/*
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
#include <queue>
*/

// GCC
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; i--)
#define each(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define pb push_back
#define mp make_pair

typedef long long ll;

const int INF = 1 << 28;
const ll INFLL = 1ll << 56;

const char *C = "^>v<";


int main()
{
	int t, a, b;
	scanf("%d %d %d", &t, &a, &b);
	
	if (max(a, b) > t){
		puts("NO");
		return 0;
	}
	
	if (t + a + b == 1){
		puts("NO");
		return 0;
	}
	
	puts("YES");
	
	// 1: up, 2: right, 4: down, 8: left
	vector<int> res;
	rep(i, (t - max(a, b)) / 2){
		res.pb(1);
		res.pb(4);
	}
	rep(i, max(a, b)){
		int x = 0;
		if (i < a) x += 1;
		if (i < b) x += 2;
		res.pb(x);
	}
	if ((t - max(a, b)) & 1){
		int x = res.back(); res.pop_back();
		if (x == 3){
			res.pb(1);
			res.pb(2);
		}
		else if (x == 1){
			res.pb(3);
			res.pb(8);
		}
		else if (x == 2){
			res.pb(3);
			res.pb(4);
		}
		else if (x == 4){
			res.pb(12);
			res.pb(2);
		}
	}
	
	for (auto x : res){
		rep(i, 4){
			if (x & (1 << i)){
				printf("%c", C[i]);
			}
		}
		puts("");
	}
}
0