結果
問題 | No.8010 Print inside /bin |
ユーザー |
![]() |
提出日時 | 2015-05-04 02:26:36 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,500 ms |
コード長 | 727 bytes |
コンパイル時間 | 922 ms |
コンパイル使用メモリ | 69,788 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-07-05 18:50:50 |
合計ジャッジ時間 | 1,735 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <sys/types.h>#include <dirent.h>#include <iostream>#include <vector>#include <algorithm>#include <string>using namespace std;int main(){DIR* dp=opendir("/bin");vector<string> v;if (dp!=NULL){struct dirent* dent;do{dent = readdir(dp);if (dent!=NULL){string t = dent->d_name;if(t[0] != '.') v.push_back(t);}}while(dent!=NULL);closedir(dp);}sort(v.begin(),v.end());for(int i = 0;i < v.size();i++)cout << v[i] << endl;return 0;}