結果

問題 No.232 めぐるはめぐる (2)
ユーザー uafr_csuafr_cs
提出日時 2015-07-01 01:13:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,309 bytes
コンパイル時間 2,785 ms
コンパイル使用メモリ 74,296 KB
実行使用メモリ 65,344 KB
最終ジャッジ日時 2023-09-22 04:49:13
合計ジャッジ時間 11,174 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 631 ms
65,216 KB
testcase_01 AC 615 ms
65,344 KB
testcase_02 AC 638 ms
65,216 KB
testcase_03 AC 642 ms
65,024 KB
testcase_04 AC 120 ms
53,500 KB
testcase_05 AC 121 ms
55,472 KB
testcase_06 AC 120 ms
55,512 KB
testcase_07 AC 120 ms
55,624 KB
testcase_08 AC 504 ms
64,348 KB
testcase_09 AC 120 ms
56,388 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 119 ms
55,596 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 121 ms
55,540 KB
testcase_16 AC 120 ms
56,436 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 120 ms
55,752 KB
testcase_22 WA -
testcase_23 AC 119 ms
55,552 KB
testcase_24 AC 125 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {

	public static final int EXP = 3000000;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		final int T = sc.nextInt();
		final int A = sc.nextInt();
		final int B = sc.nextInt();
		
		final int minimum_cost = Math.max(A, B);
		final int min_range = Math.min(A, B);
		
		if(T < minimum_cost){
			System.out.println("NO");
			return;
		}else if(min_range == 0 && (T % 2) != (minimum_cost % 2)){
			System.out.println("NO");
			return;
		}
		
		System.out.println("YES");
		
		int limit = min_range, cnt = 0;
		if((minimum_cost % 2) != (T % 2)){
			System.out.println(">");
			System.out.println("^");
			limit--;
			cnt++;
		}
		
		for(int i = 0; i < limit; i++){
			System.out.println(">^");
			cnt++;
		}
		
		for(int x = min_range; x < B; x++){
			System.out.println(">");
			cnt++;
		}
		for(int y = min_range; y < A; y++){
			System.out.println("^");
			cnt++;
		}
		
		if(limit < 0){
			System.out.println("<v");
			cnt++;
		}
		
		for(int i = cnt; i < T; i += 2){
			System.out.println("^");
			System.out.println("v");
		}
		
		
	}
}
0