結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2015-12-20 23:50:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 962 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 60,156 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-17 12:26:12 |
合計ジャッジ時間 | 3,719 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 10 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; int main() { int t, a, b; cin >> t >> a >> b; if(t < max(a, b) || a == 0 && b == 0 && t == 1) { cout << "NO" << endl; return 0; } cout << "YES" << endl; int x = 0, y = 0; while(max(a - x, b - y) > 1) { if(a - x != 0) { x++; cout << ">"; } if(b - y != 0) { y++; cout << "^"; } t--; cout << endl; } if(a - x + b - x == 2) { if(t % 2 == 0) { cout << "^" << endl; cout << ">" << endl; t -= 2; } else { cout << "^>" << endl; t--; } } else if(a - x == 0) { if(t % 2 == 0) { cout << "^" << endl; cout << ">v" << endl; t -= 2; } else { cout << ">" << endl; t--; } } else { if(t % 2 == 0) { cout << ">" << endl; cout << "^<" << endl; t -= 2; } else { cout << "^" << endl; t--; } } while(t > 0) { cout << ">" << endl; cout << "<" << endl; t -= 2; } }