結果
| 問題 |
No.232 めぐるはめぐる (2)
|
| コンテスト | |
| ユーザー |
kagasan
|
| 提出日時 | 2019-08-24 20:41:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,376 bytes |
| コンパイル時間 | 1,547 ms |
| コンパイル使用メモリ | 168,076 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-14 13:16:27 |
| 合計ジャッジ時間 | 4,430 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 WA * 7 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;};
int main(){
ll T, A, B;
cin >> T >> A >> B;
if(T < A || T < B){
cout << "NO" << endl;
return 0;
}
if(T == 1 && A == 0 && B == 0){
cout << "NO" << endl;
return 0;
}
cout << "YES" << endl;
ll y = 0, x = 0;
for(ll i = 0; i < T; i++){
ll t = T - i;
if(y == A && x == B){
cout << "<"<<endl;
x--;
continue;
}
if(t != 2){
if(y < A)cout << "^";
if(x < B)cout << ">";
cout << endl;
y++;
x++;
continue;
}
if(y == A && x + 1 == B){
cout << "^" << endl;
cout << "v>" << endl;
x++;
i++;
}
else if(x == B && y + 1 == A){
cout << ">" << endl;
cout << "<^" << endl;
y++;
i++;
}
else if(y + 1 == A && x + 1 == B){
cout << "^" << endl;
cout << ">" << endl;
i++;
}
else{
if(y < A)cout << "^";
if(x < B)cout << ">";
cout << endl;
y++;
x++;
}
}
return 0;
}
kagasan