結果

問題 No.232 めぐるはめぐる (2)
ユーザー aaaaaaiu
提出日時 2019-08-25 01:35:32
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 759 bytes
コンパイル時間 1,808 ms
コンパイル使用メモリ 192,336 KB
最終ジャッジ日時 2025-01-07 14:53:44
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int t,y,x;
    cin>>t>>y>>x;
    if (t<y||t<x||t==1&&y==0&&x==0) {
        puts("NO");
        return 0;
    }
    puts("YES");
    if ((t-x)%2==1&&(t-y)%2==1) {
        cout<<'^'<<endl;
        y--;
        t--;
    }
    while (t) {
        if ((t-x)%2==0) {
            if (x==-1) {
                cout<<'<';
                x++;
            } else {
                cout<<'>';
                x--;
            }
        }
        if ((t-y)%2==0) {
            if (y==-1) {
                cout<<'v';
                y++;
            } else {
                cout<<'^';
                y--;
            }
        }
        cout<<endl;
        t--;
    }
    return 0;
}
0