結果

問題 No.3010 Print inside /bin
ユーザー omuomu
提出日時 2015-05-04 02:13:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 739 ms
コンパイル使用メモリ 71,244 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-19 06:38:10
合計ジャッジ時間 1,491 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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)v.push_back(dent->d_name);
                 }while(dent!=NULL);
                closedir(dp);
        }
        sort(v.begin(),v.end());
        for(int i = 0;i < v.size();i++)cout << v[i] << endl;
        return 0;
}
0