結果

問題 No.232 めぐるはめぐる (2)
ユーザー かにかに
提出日時 2015-06-30 23:57:36
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 2,723 bytes
コンパイル時間 722 ms
コンパイル使用メモリ 90,220 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 04:46:18
合計ジャッジ時間 4,501 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
#define aLL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXISt(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define MaX 100000000
#define pb push_back
using namespace std; 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
int dx[] = {0,1,0,-1};
int dy[] = {-1,0,1,0};

int main(){
  int t,a,b;
  cin >> t >> a >> b;
  if(a > t || b > t){
    P("NO");
  }
  if(a == b){
    if((t - a)%2 == 0){
      P("YES");
      for(int i = 0;i < a;i++){
        P("^>");
      }
      for(int i = 0;i < (t-a)/2;i++){
        P("<");
        P(">");
      }
    }else{
      P("YES");
      for(int i = 0;i < a+1;i++){
        P("^>");
      }
      P("v");
      P("<");
      for(int i = 0;i < (t-a-3)/2;i++){
        P("^");
        P("v");
      }
    }
  }else{
    P("YES");
    int m = min(a,b);
    for(int i = 0;i < m;i++){
      P("^>");
    }
    if(a > b){
      if(t - a == 1){
        P("^>");
        P("<");
        return 0;
      }
      for(int i = 0;i < a-b;i++){
        P(">");
      }
      if((t-a)%2 == 0){
        for(int i = 0;i < (t-a)/2;i++){
          P("^");
          P("v");
        }
      }else{
        if(t-a == 1){
          return 0;
        }

        if(t-a == 3){
          P("^>");
          P("v");
          P("<");
          return 0;
        }
        P("^>");
        P("v");
        P("<");
        for(int i = 0;i < (t-a-3)/2;i++){
          P("^");
          P("v");
        }
      }
    }else if(b > a){
      if(t - b == 1){
        P("^");
        P("v>");
        return 0;
      }
      for(int i = 0;i < b-a;i++){
        P(">");
      }
      if((t-b)%2 == 0){
        for(int i = 0;i < (t-b)/2;i++){
          P("^");
          P("v");
        }
      }else{
        if(t - b== 1){
          return 0;
        }
        if(t-b == 3){
          P("^>");
          P("v");
          P("<");
          return 0;
        }
        P("^>");
        P("v");
        P("<");
        for(int i = 0;i < (t-b-3)/2;i++){
          P("^");
          P("v");
        }
      }
    }
  }
}
0