結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
|
提出日時 | 2020-08-02 15:07:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,028 bytes |
コンパイル時間 | 923 ms |
コンパイル使用メモリ | 78,584 KB |
最終ジャッジ日時 | 2025-01-12 13:19:17 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 11 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <string> void fail() { std::cout << "NO\n"; std::exit(0); } void solve() { int t, a, b; std::cin >> t >> a >> b; std::vector<std::string> xs(t, ""), ys(t, ""); { if (a > t) fail(); for (int i = 0; i < a; ++i) xs[i].push_back('>'); for (int i = a; i + 1 < t; i += 2) { xs[i].push_back('>'); xs[i + 1].push_back('<'); } std::reverse(xs.begin(), xs.end()); } { if (b > t) fail(); for (int i = 0; i < b; ++i) ys[i].push_back('^'); for (int i = b; i + 1 < t; i += 2) { ys[i].push_back('^'); ys[i + 1].push_back('v'); } } if (xs.front().empty() && ys.front().empty()) fail(); std::cout << "YES\n"; for (int i = 0; i < t; ++i) { std::cout << xs[i] << ys[i] << "\n"; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }