結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2016-03-18 12:58:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 908 bytes |
コンパイル時間 | 546 ms |
コンパイル使用メモリ | 60,948 KB |
実行使用メモリ | 16,840 KB |
最終ジャッジ日時 | 2024-10-01 09:07:13 |
合計ジャッジ時間 | 5,045 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | TLE * 1 -- * 21 |
ソースコード
#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){ if(min(a,b) == a){ a--; cout << '^' << endl; }else{ b--; cout << '>' << endl; } t--; } 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 << 'v' << endl; t -= 3; } }else{ while(t){ cout << '>' << endl << '<' << endl; t -= 2; } } } }