結果

問題 No.8010 Print inside /bin
コンテスト
ユーザー Kmcode1
提出日時 2015-05-04 01:51:14
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 1,123 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 942 ms
コンパイル使用メモリ 142,340 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-27 04:05:26
合計ジャッジ時間 1,248 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<valarray>
//#include<bits/stdc++.h>
using namespace std;
//#include <iostream>
//#include <cstdlib>
#include <dirent.h>
vector<string> v;
int main()
{
	const char* path = "/bin";
	DIR *dp;       // ディレクトリへのポインタ
	dirent* entry; // readdir() で返されるエントリーポイント

	dp = opendir(path);
	if (dp == NULL) exit(1);
	do {
		entry = readdir(dp);
		if (entry != NULL)break;
		stringstream aa;
		aa << (entry->d_name);
		if (aa.str()[0] == '.'){
			continue;
		}
		v.push_back(aa.str());
		//cout << aa.str() << endl;
	} while (entry != NULL);
	sort(v.begin(), v.end());
	for (int i = 0; i < v.size(); i++){
		cout << v[i] << endl;
	}
	return 0;
}
0