結果

問題 No.3010 Print inside /bin
ユーザー ぴろずぴろず
提出日時 2015-05-04 00:06:44
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 635 bytes
コンパイル時間 3,348 ms
コンパイル使用メモリ 74,300 KB
実行使用メモリ 56,584 KB
最終ジャッジ日時 2023-09-19 05:45:38
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
		}
	}

}
0