結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー |
![]() |
提出日時 | 2015-06-27 00:20:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,434 bytes |
コンパイル時間 | 369 ms |
コンパイル使用メモリ | 54,364 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 19:36:21 |
合計ジャッジ時間 | 2,227 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 3 |
ソースコード
#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; } }