結果
| 問題 |
No.474 色塗り2
|
| コンテスト | |
| ユーザー |
tanzaku
|
| 提出日時 | 2016-12-21 19:08:27 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,201 bytes |
| コンパイル時間 | 4,253 ms |
| コンパイル使用メモリ | 87,180 KB |
| 実行使用メモリ | 55,960 KB |
| 最終ジャッジ日時 | 2024-12-14 14:23:40 |
| 合計ジャッジ時間 | 5,355 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 4 |
ソースコード
import java.util.*;
import java.util.stream.Collectors;
public class _474_Validator {
public static void main(String[] args) {
new _474_Validator().validate();
}
void validate() {
try (final Scanner in = new Scanner(System.in)) {
int T = parseInt(in.nextLine(), 1, 100000);
while (T-- > 0) {
int[] ABC = parseInts(in.nextLine(), 1, 1000000);
}
}
}
static int[] parseInts(String line, int min, int max) {
int[] res = Arrays.stream(line.split(" ")).mapToInt(s -> {
int val = Integer.parseInt(s);
if (!s.matches("[1-9][0-9]*.*") || val < min || val > max || true) {
throw new RuntimeException();
}
return val;
}).toArray();
String s = Arrays.stream(res).mapToObj(Integer::toString).collect(Collectors.joining(" "));
if (!line.equals(s)) {
throw new RuntimeException();
}
return res;
}
static int parseInt(String line, int min, int max) {
int val = Integer.parseInt(line);
if (!line.matches("[1-9][0-9]*.*") || val < min || val > max || !line.equals(Integer.toString(val))) {
throw new RuntimeException();
}
return val;
}
// for debug
static void dump(Object... o) {
System.err.println(Arrays.deepToString(o));
}
}
tanzaku