結果

問題 No.232 めぐるはめぐる (2)
ユーザー fumofumofunifumofumofuni
提出日時 2021-03-17 00:04:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,039 bytes
コンパイル時間 2,170 ms
コンパイル使用メモリ 202,208 KB
実行使用メモリ 9,048 KB
最終ジャッジ日時 2024-04-26 06:59:33
合計ジャッジ時間 4,229 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
8,148 KB
testcase_01 AC 134 ms
9,048 KB
testcase_02 AC 135 ms
7,764 KB
testcase_03 AC 135 ms
8,280 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 97 ms
7,888 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 3 ms
6,940 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 WA -
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 2 ms
6,944 KB
testcase_18 AC 3 ms
6,944 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=(n)-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={-1,0,1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n,h,w;cin >> n >> h >> w;
    if(h==w&&h==0&&n==1){
        cout << "NO" <<endl;return 0;
    }

    if(n<max(h,w))cout << "NO" <<endl,exit(0);
    cout << "YES" <<endl;
    vector<string> ans;
    ll p=min(h,w);
    rep(i,p)ans.push_back(">^");
    rep(i,h-p)ans.push_back("^");
    rep(i,w-p)ans.push_back(">");
    if(n-ans.size()!=1){
        ll rem=n-ans.size();
        if(rem%2){
            rem-=3;
            ans.push_back("^");
            ans.push_back("v>");
            ans.push_back("<");
        }
        rep(i,rem/2){
            ans.push_back("<");
            ans.push_back(">");
        }
        rep(i,n)cout << ans[i] <<endl;
        return 0;
    }
    rev(all(ans));
    if(ans[0]==">^"){
        ans[0]="^";ans.push_back(">");
    }
    else if(ans[0]=="^"){
        ans.pop_back();
        ans.push_back(">");
        ans.push_back("^<");
    }
    else {
        ans.pop_back();
        ans.push_back("^");
        ans.push_back("v>");
    }
    rep(i,n)cout << ans[i] <<endl;
}   
0