結果
| 問題 |
No.8012 Catch C code
|
| ユーザー |
Lay_ec
|
| 提出日時 | 2015-09-01 05:17:20 |
| 言語 | Text (cat 8.3) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,500 ms |
| コード長 | 759 bytes |
| コンパイル時間 | 49 ms |
| コンパイル使用メモリ | 6,944 KB |
| 実行使用メモリ | 6,812 KB |
| 最終ジャッジ日時 | 2024-07-18 17:22:34 |
| 合計ジャッジ時間 | 986 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <iostream>
#include <string>
#include <fstream>
#include <dirent.h>
using namespace std;
int main(){
DIR* dir=opendir("./");
dirent* ent;
string name;
while(ent=readdir(dir),ent!=NULL){
name=string(ent->d_name);
if(name[name.size()-2]=='.' && name[name.size()-1]=='o') break;
}
ifstream ifs(name.c_str(),ios::binary);
char c1,c2,c3,c4,c5;
ifs>>c1>>c2>>c3>>c4;
while(!ifs.eof()){
ifs>>c5;
if(c1=='F' && c2=='L' && c3=='A' && c4=='G' && c5=='_'){
cout<<"FLAG_";
char c;
while(ifs>>c , c!=0) cout<<c;
cout<<endl;
return 0;
}
c1=c2; c2=c3; c3=c4; c4=c5;
}
return 0;
}
Lay_ec