結果
| 問題 | No.232 めぐるはめぐる (2) | 
| コンテスト | |
| ユーザー |  nbkwon | 
| 提出日時 | 2015-09-26 01:09:41 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 1,885 bytes | 
| コンパイル時間 | 447 ms | 
| コンパイル使用メモリ | 58,464 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-19 09:36:02 | 
| 合計ジャッジ時間 | 2,489 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 WA * 1 | 
ソースコード
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int t;
	int x;
	int y;
	cin >> t >> y >> x;
	if (t < x || t < y)
	{
		cout << "NO" << endl;
		return 0;
	}
	if (t == 1)
	{
		if (x == 0 && y == 0)
		{
			cout << "NO" << endl;
			return 0;
		}
		cout << "YES" << endl;
		if (x > 0)
		{
			x--;
			cout << ">";//한칸가줬다
		}
		if (y > 0)
		{
			y--;
			cout << "^";//한칸가줬다
		}
		//일단 전진
		cout << endl;
		return 0;
	}
	if (1)
	{
		cout << "YES" << endl;
		for (int i = 0; i < t - 2; i++)//두단계 전까지 간다
		{
			if (x > 0)
			{
				x--;
				cout << ">";//한칸가줬다
			}
			else//x가 0
			{
				x++;
				cout << "<";
			}
			if (y > 0)
			{
				y--;
				cout << "^";//한칸가줬다
			}
			else//x가 0
			{
				y++;
				cout << "v";
			}
			//일단 전진
			cout << endl;
		}
		//4가지 케이스가 있음. -1 0
		if (x == 1 && y == 1)
		{
			cout << ">" << endl;
			cout << "^" << endl;
			//cout << "a";
			return 0;
		}
		if (x == 0 && y == 1)
		{
			cout << "<" << endl;
			cout << ">^" << endl;
			//cout << "b";
			return 0;
		}
		if (x == 1 && y == 0)
		{
			cout << ">^" << endl;
			cout << "v" << endl;
			return 0;
		}
		if (x == 0 && y == 0)
		{
			cout << "<^" << endl;
			cout << ">v" << endl;
			//cout << "d";
			return 0;
		}
		//cout << "뭐지 이건";
		if (x > 0)
		{
			x--;
			cout << ">";//한칸가줬다
		}
		else//x가 0
		{
			x++;
			cout << "<";
		}
		if (y > 0)
		{
			y--;
			cout << "^";//한칸가줬다
		}
		else//x가 0
		{
			y++;
			cout << "v";
		}//t는 1
		cout << endl;
		if (x > 0)
		{
			x--;
			cout << ">";//한칸가줬다
		}
		else//x가 0
		{
			x++;
			cout << "<";
		}
		if (y > 0)
		{
			y--;
			cout << "^";//한칸가줬다
		}
		else//x가 0
		{
			y++;
			cout << "v";
		}//t는 1
		cout << endl;
	}
}
            
            
            
        