結果

問題 No.232 めぐるはめぐる (2)
ユーザー ldsybldsyb
提出日時 2016-03-18 12:09:34
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 804 bytes
コンパイル時間 904 ms
コンパイル使用メモリ 60,736 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 16:56:53
合計ジャッジ時間 4,443 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 134 ms
6,676 KB
testcase_02 AC 133 ms
6,676 KB
testcase_03 AC 129 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 WA -
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 94 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) cout << "NO" << endl;
   else if(a == b && a == 0) cout << "NO" << endl;
   else{
      cout << "YES" << endl;
      if(t - max(a,b) == 1){
         cout << '^' << endl;
         a--;
      }
      while(a && b){
         cout << "^>" << endl;
         a--; b--; t--;
      }
      while(a--){
         cout << '^' << endl;
         t--;
      }
      while(b--){
         cout << '>' << endl;
         t--;
      }
      if(!(t & 1)){
         while(t){
            cout << '>' << endl << '<' << endl;
            t -= 2;
         }
      }else{
         while(t){
            cout << "^>" << endl << '<' << endl << 'v' << endl;
            t -= 3;
         }
      }
   }
}
0