結果

問題 No.232 めぐるはめぐる (2)
ユーザー ldsybldsyb
提出日時 2016-03-18 22:14:04
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 911 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 60,548 KB
実行使用メモリ 9,748 KB
最終ジャッジ日時 2024-04-08 17:00:08
合計ジャッジ時間 4,372 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;

int main(){
   int t,a,b;
   cin >> t >> a >> b;
   if(max(a,b) > t || t == 1 && a == 0 && b == 0) cout << "NO" << endl;
   else{
      cout << "YES" << endl;
      if(t - max(a,b) == 1){
         t--;
         if(min(a,b) == a){
            cout << '^' << endl;
            a--;
         }else{
            cout << '>' << endl;
            b--;
         }
      }
      while(a && b){
         cout << "^>" << endl;
         t--; a--; b--;
      }
      while(a){
         cout << '^' << endl;
         t--; a--;
      }
      while(b){
         cout << '>' << endl;
         t--; b--;
      }
      if(t & 1){
         while(t){
            cout << "^>" << endl << '<' << endl << 'v' << endl;
            t -= 3;
         }
      }else{
         while(t){
            cout << '>' << endl << '<' << endl;
            t -= 2;
         }
      }
   }
}
0