結果

問題 No.232 めぐるはめぐる (2)
ユーザー ldsyb
提出日時 2016-03-18 22:14:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 911 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 60,708 KB
実行使用メモリ 13,636 KB
最終ジャッジ日時 2024-10-01 09:07:57
合計ジャッジ時間 3,962 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other AC * 10 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

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