結果
| 問題 |
No.8010 Print inside /bin
|
| コンテスト | |
| ユーザー |
ぴろず
|
| 提出日時 | 2015-05-04 00:02:05 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 636 bytes |
| コンパイル時間 | 2,582 ms |
| コンパイル使用メモリ | 86,420 KB |
| 実行使用メモリ | 42,304 KB |
| 最終ジャッジ日時 | 2024-07-05 18:02:58 |
| 合計ジャッジ時間 | 2,850 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 1 |
ソースコード
package no3010;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Process pr = Runtime.getRuntime().exec("ls ~/bin -F");
Scanner sc = new Scanner(pr.getInputStream());
ArrayList<String> lis = new ArrayList<>();
int count = 0;
while(sc.hasNext()) {
count++;
String s = sc.next();
if (s.startsWith(".") || s.endsWith("/")) {
continue;
}
lis.add(s);
}
if (count < 2) {
throw new RuntimeException();
}
Collections.sort(lis);
for(String s: lis) {
System.out.println(s);
}
}
}
ぴろず