結果

問題 No.3010 Print inside /bin
ユーザー ぴろずぴろず
提出日時 2015-05-04 00:13:53
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 622 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 73,444 KB
実行使用メモリ 145,620 KB
最終ジャッジ日時 2023-09-19 05:48:39
合計ジャッジ時間 7,908 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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<>();
		try {
			while(true) {
				if (sc.hasNext()) {
					String s = sc.next();
					if (s.startsWith(".") || s.endsWith("/")) {
						continue;
					}
					lis.add(s);
				}
			}
		}catch (Exception e) {

		}
		Collections.sort(lis);
		for(String s: lis) {
			System.out.println(s);
		}
	}

}
0