結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー |
![]() |
提出日時 | 2015-12-21 00:03:07 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,097 bytes |
コンパイル時間 | 2,199 ms |
コンパイル使用メモリ | 60,176 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 21:08:44 |
合計ジャッジ時間 | 3,058 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 11 |
ソースコード
#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(b == y) { 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; } }