結果

問題 No.232 めぐるはめぐる (2)
ユーザー nCk_cvnCk_cv
提出日時 2015-08-03 02:16:54
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,123 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 74,692 KB
実行使用メモリ 68,688 KB
最終ジャッジ日時 2023-09-25 00:40:41
合計ジャッジ時間 9,876 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 566 ms
68,688 KB
testcase_02 AC 617 ms
65,216 KB
testcase_03 AC 552 ms
68,628 KB
testcase_04 AC 172 ms
62,572 KB
testcase_05 AC 124 ms
55,720 KB
testcase_06 WA -
testcase_07 AC 160 ms
58,184 KB
testcase_08 AC 494 ms
66,736 KB
testcase_09 AC 161 ms
58,368 KB
testcase_10 AC 131 ms
55,628 KB
testcase_11 WA -
testcase_12 AC 123 ms
55,840 KB
testcase_13 WA -
testcase_14 AC 123 ms
55,868 KB
testcase_15 WA -
testcase_16 AC 124 ms
55,708 KB
testcase_17 AC 127 ms
55,860 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 123 ms
55,732 KB
testcase_22 AC 124 ms
55,924 KB
testcase_23 AC 123 ms
56,416 KB
testcase_24 AC 129 ms
55,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
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();
		
		int nowa = 0;
		int nowb = 0;
		
		
		int i;
		ArrayList<String> list = new ArrayList<String>();
		
		for(i = 0; i < t-1; i++) {
			if(nowa == a-1 && nowb == b-1) break;
			StringBuilder sb = new StringBuilder();
			if(nowa < a-1) {
				nowa++;
				sb.append("^");
			}
			if(nowb < b-1) {
				nowb++;
				sb.append(">");
			}
			list.add(sb.toString());
		}
		if(nowa != a-1 || nowb != b-1) {
			System.out.println("NO");
			return;
		}
		System.out.println("YES");
		for(int j = 0; j < list.size(); j++) {
			System.out.println(list.get(j));
		}
		if(i == t-1) {
			System.out.println("^>");
			return;
		}
		i++;
		nowa++;
		System.out.println("^");
		for(; i < t-1; i++) {
			if(nowa == a) {
				System.out.println("v>");
				nowa = a-1;
			}
			else {
				System.out.println("^<");
				nowa = a;
			}
		}
		if(nowa == a) {
			System.out.println(">");
		}
		else {
			System.out.println("^");
		}
		
		
		
		
		
		
		
		
		
	}
}
0