結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2015-12-20 23:55:23 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,101 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 60,696 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 21:07:39 |
合計ジャッジ時間 | 3,336 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 7 |
ソースコード
#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 == y) { if(t % 2 == 1) { cout << "^" << endl; cout << ">" << endl; cout << "<v" << endl; t -= 3; } } else if(a - x + b - y == 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; } }