結果

問題 No.232 めぐるはめぐる (2)
ユーザー GrenacheGrenache
提出日時 2015-06-27 00:15:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,307 bytes
コンパイル時間 4,177 ms
コンパイル使用メモリ 74,484 KB
実行使用メモリ 59,080 KB
最終ジャッジ日時 2023-09-22 02:44:57
合計ジャッジ時間 11,986 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 128 ms
55,760 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 132 ms
55,880 KB
testcase_08 WA -
testcase_09 AC 128 ms
55,780 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 124 ms
55,768 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

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) {
        	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 {
        	System.out.println("NO");
        }
        
        sc.close();
        pr.close();
    }

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