結果

問題 No.232 めぐるはめぐる (2)
ユーザー GrenacheGrenache
提出日時 2015-06-27 00:30:03
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,351 bytes
コンパイル時間 3,685 ms
コンパイル使用メモリ 75,168 KB
実行使用メモリ 56,880 KB
最終ジャッジ日時 2023-09-22 02:50:46
合計ジャッジ時間 9,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 246 ms
56,424 KB
testcase_01 AC 248 ms
56,732 KB
testcase_02 AC 257 ms
56,880 KB
testcase_03 AC 243 ms
56,600 KB
testcase_04 AC 135 ms
55,644 KB
testcase_05 AC 136 ms
55,644 KB
testcase_06 AC 137 ms
55,480 KB
testcase_07 AC 133 ms
55,692 KB
testcase_08 AC 233 ms
54,544 KB
testcase_09 AC 141 ms
55,556 KB
testcase_10 AC 143 ms
55,432 KB
testcase_11 WA -
testcase_12 AC 136 ms
55,508 KB
testcase_13 AC 144 ms
55,704 KB
testcase_14 AC 137 ms
55,808 KB
testcase_15 AC 136 ms
55,644 KB
testcase_16 AC 136 ms
55,708 KB
testcase_17 AC 135 ms
55,696 KB
testcase_18 AC 146 ms
55,892 KB
testcase_19 WA -
testcase_20 AC 134 ms
55,384 KB
testcase_21 AC 135 ms
55,496 KB
testcase_22 AC 136 ms
55,752 KB
testcase_23 AC 136 ms
55,496 KB
testcase_24 AC 139 ms
55,512 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 && (len != 0 || t != 1)) {
        	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