結果

問題 No.232 めぐるはめぐる (2)
ユーザー kou6839kou6839
提出日時 2015-06-27 00:02:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 793 bytes
コンパイル時間 1,887 ms
コンパイル使用メモリ 74,284 KB
実行使用メモリ 513,112 KB
最終ジャッジ日時 2023-09-22 02:37:33
合計ジャッジ時間 10,347 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 635 ms
65,444 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 119 ms
55,708 KB
testcase_05 AC 117 ms
55,888 KB
testcase_06 WA -
testcase_07 AC 119 ms
55,880 KB
testcase_08 WA -
testcase_09 AC 118 ms
56,104 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
testcase_16 AC 128 ms
54,084 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 117 ms
55,944 KB
testcase_22 WA -
testcase_23 AC 117 ms
55,676 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


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();
		if(A<B){
			int tmp = A;
			A=B;
			B=tmp;
		}
		int need = A;
		if(T < need  || T==need+1){
			System.out.println("NO");
			return;
		}

		System.out.println("YES");
		for(int i=0;i<B;i++){
			System.out.println("^>");
		}
		int rest = T - B;
		if(rest==0) return;
		StringBuilder sb = new StringBuilder();
		while(true){
			if(rest == 2){
				sb.append(">\n");
				sb.append("<\n");
				break;
			}
			if(rest == 3){
				sb.append("^>\n");
				sb.append("<\n");
				sb.append("v\n");
				break;
			}
			sb.append(">\n");
			sb.append("<\n");
			rest-=2;
		}
		System.out.println(sb);
	}
}
0