結果

問題 No.232 めぐるはめぐる (2)
ユーザー lunnearlunnear
提出日時 2018-12-13 10:59:29
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 748 bytes
コンパイル時間 1,250 ms
コンパイル使用メモリ 56,196 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 09:10:36
合計ジャッジ時間 4,339 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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