結果

問題 No.232 めぐるはめぐる (2)
ユーザー GrenacheGrenache
提出日時 2015-06-27 00:19:44
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,337 bytes
コンパイル時間 3,633 ms
コンパイル使用メモリ 74,664 KB
実行使用メモリ 57,820 KB
最終ジャッジ日時 2023-09-22 02:48:48
合計ジャッジ時間 9,519 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 238 ms
56,492 KB
testcase_01 AC 235 ms
56,772 KB
testcase_02 AC 228 ms
56,824 KB
testcase_03 AC 233 ms
56,360 KB
testcase_04 AC 130 ms
55,504 KB
testcase_05 AC 130 ms
56,088 KB
testcase_06 AC 130 ms
55,668 KB
testcase_07 AC 132 ms
53,740 KB
testcase_08 AC 238 ms
56,372 KB
testcase_09 AC 130 ms
55,684 KB
testcase_10 AC 133 ms
55,944 KB
testcase_11 WA -
testcase_12 AC 131 ms
55,988 KB
testcase_13 AC 131 ms
55,704 KB
testcase_14 AC 132 ms
55,632 KB
testcase_15 WA -
testcase_16 AC 129 ms
55,916 KB
testcase_17 AC 131 ms
55,808 KB
testcase_18 AC 144 ms
55,964 KB
testcase_19 WA -
testcase_20 AC 130 ms
55,928 KB
testcase_21 AC 133 ms
55,792 KB
testcase_22 AC 130 ms
55,464 KB
testcase_23 AC 130 ms
55,652 KB
testcase_24 AC 133 ms
55,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Scanner;


public class Main_yukicoder232 {

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

        int t = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int len = Math.min(a, b) + Math.abs(a - b);
        int x = 0;
        int y = 0;
        if (t >= len && t >= 2) {
        	pr.println("YES");
        	for (int i = 0; i < t; i++) {
        		int d = Math.min(b - x, a - y) + Math.abs(b - x - (a - y));
        		if (a - y > b - x) {
        			pr.println("^");
        			y++;
        		} else if (a - y < b - x) {
        			pr.println(">");
        			x++;
        		} else {
        			if (a - y != 0) {
        				if ((t - i - d) % 2 == 0) {
        					pr.println("^>");
        					x++;
        					y++;
        				} else {
        					pr.println(">");
        					x++;
        				}
        			} else {
        				pr.println("v<");
        				x--;
        				y--;
        			}
        		}
        	}
        } else {
        	pr.println("NO");
        }
        
        sc.close();
        pr.close();
    }

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0