結果

問題 No.232 めぐるはめぐる (2)
ユーザー lunnear
提出日時 2018-12-13 10:59:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 748 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 55,980 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-25 04:17:46
合計ジャッジ時間 3,216 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main()
{
    int t, p[2];
    std::cin >> t >> p[0] >> p[1];
    
    int hi = (p[0] > p[1])? 0:1;
    
    if(t < p[hi])
    {
        std::cout << "NO" << std::endl;
        return 0;
    }
    
    std::cout << "YES" << std::endl;    
    for(int i = 0; i < (p[hi ^ 1] - 1); i++)
    {
        std::cout << ">^" << std::endl;
        t--;
    }
    
    char s[2] = {0};
    s[0] = (hi == 0)? '^':'>';
    for(int i = 0; i < (p[hi] - p[hi ^ 1]); i++)
    {
        std::cout << s << std::endl;
        t--;
    }
    
    int i;
    for(i = 0; t > 1; i++)
    {
        std::cout << (((i % 2) == 0)? ">":"<") << std::endl;
        t--;
    }
    std::cout << (((i % 2) == 0)? ">^":"^") << std::endl;
    
    return 0;
}
0