結果

問題 No.232 めぐるはめぐる (2)
ユーザー 0w1
提出日時 2016-11-29 15:25:35
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,138 bytes
コンパイル時間 1,678 ms
コンパイル使用メモリ 168,772 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-11-27 13:28:58
合計ジャッジ時間 6,730 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 6 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

const string msg[] = { "NO", "YES" };

signed main(){
  int T, A, B; cin >> T >> A >> B;
  if( max( A, B ) > T )
    cout << msg[ 0 ] << endl, exit( 0 );
  cout << msg[ 1 ] << endl;
  int mov = T - ( max( A, B ) - min( A, B ) ) - min( A, B );
  for( int i = 0; i < max( A, B ) - min( A, B ); ++i ){
    if( mov == 1 ){
      if( A == max( A, B ) )
        cout << "^v"[ A > 0 ] << ">" << endl,
        cout << "<" << endl;
      else
        cout << "<>"[ B > 0 ] << "^" << endl,
        cout << "v" << endl;
      --mov;
      continue;
    }
    if( A == max( A, B ) )
      cout << "^v"[ A > 0 ] << endl;
    else
      cout << "<>"[ B > 0 ] << endl; 
  }
  for( int i = 0; i < min( A, B ); ++i ){
    if( mov == 1 ){
      cout << "<>"[ B > 0 ] << endl;
      cout << "v^"[ A > 0 ] << endl;
      --mov;
      continue; 
    }
    cout << "<>"[ B > 0 ] << "v^"[ A > 0 ] << endl;
  }
  if( mov & 1 ){
    cout << ">^" << endl;
    cout << "v" << endl;
    cout << "<" << endl;
    mov -= 3; 
  }
  while( mov )
    cout << ">" << endl,
    cout << "<" << endl,
    mov -= 2;
  return 0;
}
0