結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
chakku
|
| 提出日時 | 2015-09-26 03:55:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,106 bytes |
| コンパイル時間 | 529 ms |
| コンパイル使用メモリ | 67,412 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 10:34:35 |
| 合計ジャッジ時間 | 2,436 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 1 |
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <string>
#include <climits>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<":"<<x<<endl
const int INF = INT_MAX / 3;
int main(){
int T, A, B;
cin >> T >> A >> B;
if (T < max(A, B)){
cout << "NO" << endl;
return 0;
}
if (T == 1 && A == 0 && B == 0){
cout << "NO" << endl;
return 0;
}
cout << "YES" << endl;
int res = T - max(A, B);
if (res % 2 == 1){
if (A == 0){
cout << ">^" << endl << "v" << endl;
B--;
T--; T--;
} else if (B == 0){
cout << ">^" << endl << "<" << endl;
A--;
T--; T--;
} else{
cout << ">" << endl << "^" << endl;
A--; B--;
T--; T--;
}
}
for (int i = 0; i < min(A, B); i++){
cout << ">^" << endl;
}
for (int i = min(A, B); i < T; i++){
if (i < max(A, B)){
if (A>B) cout << "^" << endl;
else cout << ">" << endl;
} else{
if (i % 2) cout << "^" << endl;
else cout << "v" << endl;
}
}
return 0;
}
chakku