結果
| 問題 | No.8010 Print inside /bin |
| コンテスト | |
| ユーザー |
Kmcode1
|
| 提出日時 | 2015-05-04 00:12:17 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 993 bytes |
| 記録 | |
| コンパイル時間 | 847 ms |
| コンパイル使用メモリ | 99,292 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-07-05 18:06:16 |
| 合計ジャッジ時間 | 1,063 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 1 |
コンパイルメッセージ
In file included from /usr/include/c++/11/ios:40,
from /usr/include/c++/11/ostream:38,
from /usr/include/c++/11/iostream:39,
from main.cpp:1:
In static member function ‘static std::size_t std::char_traits<char>::length(const char_type*)’,
inlined from ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*) [with _Traits = std::char_traits<char>]’ at /usr/include/c++/11/ostream:617:44,
inlined from ‘int main()’ at main.cpp:45:23:
/usr/include/c++/11/bits/char_traits.h:399:32: warning: ‘long unsigned int __builtin_strlen(const char*)’ reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
399 | return __builtin_strlen(__s);
| ~~~~~~~~~~~~~~~~^~~~~
ソースコード
#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>
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)exit(1);
stringstream aa;
aa << (entry->d_name);
if (aa.str()[0] == '.'){
continue;
}
cout << aa.str()[0] << endl;
} while (entry != NULL);
return 0;
}
Kmcode1