結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-01-24 17:53:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,607 bytes |
| コンパイル時間 | 1,335 ms |
| コンパイル使用メモリ | 93,524 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-01-03 05:20:58 |
| 合計ジャッジ時間 | 3,988 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 4 |
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
int t, a, b;
cin >> t >> a >> b;
if (max(a, b) > t) {
cout << "NO" << endl;
return 0;
}
if (a == 0 && b == 0) {
if (t == 1) {
cout << "No" << endl;
}
else if (t % 2 == 0) {
for (int i = 0; i < t / 2; i++) {
cout << ">" << endl;
cout << "<" << endl;
}
}
else {
cout << "^" << endl;
cout << "v>" << endl;
for (int i = 0; i < t - 2; i++) {
if (i % 2 == 0) {
cout << "<" << endl;
}
else {
cout << ">" << endl;
}
}
}
return 0;
}
cout << "YES" << endl;
if (a == 0) {
if (b % 2 != t % 2) {
cout << "^" << endl;
cout << "v>" << endl;
for (int i = 0; i < b - 1; i++) {
cout << ">" << endl;
}
}
else {
for (int i = 0; i < b; i++) {
cout << ">" << endl;
}
}
for (int i = 0; i < (t - b) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
return 0;
}
if (b == 0) {
if (a % 2 != t % 2) {
cout << ">" << endl;
cout << "^<" << endl;
for (int i = 0; i < a - 1; i++) {
cout << "^" << endl;
}
}
else {
for (int i = 0; i < a; i++) {
cout << "^" << endl;
}
}
for (int i = 0; i < (t - a) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
return 0;
}
if (a < b) {
if (b % 2 != t % 2) {
for (int i = 0; i < a - 1; i++) {
cout << "^>" << endl;
}
cout << "^" << endl;
for (int i = 0; i < b - a + 1; i++) {
cout << ">" << endl;
}
for (int i = 0; i < (t - b) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
}
else {
for (int i = 0; i < a; i++) {
cout << "^>" << endl;
}
for (int i = 0; i < b - a; i++) {
cout << ">" << endl;
}
for (int i = 0; i < (t - b) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
}
}
else {
if (a % 2 != t % 2) {
for (int i = 0; i < b - 1; i++) {
cout << "^>" << endl;
}
cout << ">" << endl;
for (int i = 0; i < a - b + 1; i++) {
cout << "^" << endl;
}
for (int i = 0; i < (t - a) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
}
else {
for (int i = 0; i < b; i++) {
cout << "^>" << endl;
}
for (int i = 0; i < a - b; i++) {
cout << "^" << endl;
}
for (int i = 0; i < (t - a) / 2; i++) {
cout << "^" << endl;
cout << "v" << endl;
}
}
}
}