結果

問題 No.232 めぐるはめぐる (2)
ユーザー めうめう🎒めうめう🎒
提出日時 2016-03-29 13:24:06
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,482 bytes
コンパイル時間 617 ms
コンパイル使用メモリ 74,116 KB
実行使用メモリ 16,960 KB
最終ジャッジ日時 2024-04-10 05:45:48
合計ジャッジ時間 5,142 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define ll long long
#define INF (1 << 30)
#define INFLL (1LL << 60)

int main() {
	int t,a,b;
	cin >> t >> a >> b;
	if(t < max(a,b)){
		cout << "NO" << endl;
	}else{
		int nx = 0,ny = 0;
		cout << "YES" << endl;
		if(t - max(a,b) == 1){
			if(a == b){
				for(int i = 0;i < max(a,b) - 1;i++){
					cout << ">^" << endl;
				}
				cout << ">" << endl << "^" << endl;
			}else{
				for(int i = 0;i < min(a,b);i++){
					cout << ">^" << endl;
				}
				int m = min(a,b);
				a -= m;
				b -= m;
				if(a == 0){
					cout << ">^" << endl << "v" << endl;
					for(int i = 0;i < b - 1;i++){
						cout << ">" << endl;
					}
				}else{
					cout << ">^" << endl << "<" << endl;
					for(int i = 0;i < a - 1;i++){
						cout << "^" << endl;
					}
				}
			}
		}else{
			for(int i = 0;i < min(a,b);i++){
				cout << ">^" << endl;
				t--;
			}
			int m = min(a,b);
			a -= m;
			b -= m;
			if(a == 0){
				for(int i = 0;i < b;i++){
					cout << ">" << endl;
					t--;
				}
			}else{
				for(int i = 0;i < a;i++){
					cout << "^" << endl;
					t--;
				}
			}
			while(t){
				if(t % 2 == 1){
					t -= 3;
					cout << ">^" << endl << "<" << endl << "v" << endl;
				}else if(t == 2){
					t -= 2;
					cout << ">" << endl << "<" << endl;
				}
			}
		}
	}
	return 0;
}
0