結果
問題 |
No.232 めぐるはめぐる (2)
|
ユーザー |
![]() |
提出日時 | 2015-08-03 02:16:54 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,123 bytes |
コンパイル時間 | 2,309 ms |
コンパイル使用メモリ | 78,696 KB |
実行使用メモリ | 67,424 KB |
最終ジャッジ日時 | 2024-07-18 00:54:38 |
合計ジャッジ時間 | 10,594 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 8 |
ソースコード
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("^"); } } }