結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
qzpm
|
| 提出日時 | 2015-06-27 00:19:00 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,431 bytes |
| コンパイル時間 | 740 ms |
| コンパイル使用メモリ | 55,316 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-07 19:34:46 |
| 合計ジャッジ時間 | 5,111 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 4 WA * 18 |
ソースコード
#include <iostream>
using namespace std;
int main(void){
int T,A,B;
cin >> T >> A >> B;
int x,y;
if(T < A || T < B || (A == 0 && B == 0 && T == 1)){
cout << "NO" << endl;
}else{
cout << "YES" << endl;
x = y = 0;
int i = 0;
while(T - i){
if((A - x) + (B - y) == T - i){
if(A - x > 0){
x++;
cout << "^" << endl;
}else{
y++;
cout << ">" << endl;
}
}else if((A - x) + (B - y) > T - i){
cout << "^>" << endl;
x++;
y++;
}else if((A - x) == (B - y) == T - i){
cout << "^>" << endl;
x++;
y++;
}else if(A == x && B == y){
if(T == i + 2){
cout << "<" << endl;
y--;
}else{
cout << "<v" << endl;
x--;
y--;
}
}else{
if((A - x) + (B - y) == (T - i) - 1){
cout << "^<" << endl;
x++;
y--;
}else{
cout << "<" << endl;
y--;
}
}
i++;
}
cout << x << " " << y << endl;
}
}
qzpm