結果

問題 No.232 めぐるはめぐる (2)
ユーザー kohaku_kohaku
提出日時 2016-12-03 16:19:42
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 1,442 bytes
コンパイル時間 3,220 ms
コンパイル使用メモリ 77,276 KB
実行使用メモリ 63,868 KB
最終ジャッジ日時 2024-11-27 18:02:54
合計ジャッジ時間 11,026 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        int big=Math.max(A,B);
        int small=Math.min(A,B);
        int c1=small;
        int c2=0;
        if(T<big){
            System.out.println("NO");
        }else{
            System.out.println("YES");
            String S1="";
            String S2="";
            if(A<=B){
                S1=">";
                S2="^";
            }else{
                S1="^";
                S2=">";
            }
            if(T-big==1){
                c1--;
                System.out.println(S2);
            }
            c2=big-c1;
            for(int i=0; i<c1; i++){
                System.out.println(">^");
            }
            for(int i=0; i<c2; i++){
                System.out.println(S1);
            }
            stand(T-big);
        }
    }
    static void stand(int z){
        if(z<=1){
            return;
        }else if(z%2==0){
            for(int i=0; i<z/2; i++){
                System.out.println(">");
                System.out.println("<");
            }
            return;
        }else{
            System.out.println(">^");
            System.out.println("<");
            System.out.println("v");
            z-=3;
            stand(z);
            return;
        }
    }
}
0