結果
| 問題 |
No.8012 Catch C code
|
| ユーザー |
anta
|
| 提出日時 | 2015-08-31 00:50:04 |
| 言語 | Text (cat 8.3) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,500 ms |
| コード長 | 479 bytes |
| コンパイル時間 | 24 ms |
| コンパイル使用メモリ | 6,684 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-07-18 15:50:43 |
| 合計ジャッジ時間 | 670 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <cstdio>
#include <string>
using namespace std;
int main(int argc, char **argv) {
FILE *fp = fopen(argv[0], "rb");
if(!fp) {
fprintf(stderr, "file not found\n");
return 1;
}
fseek(fp, 0, SEEK_END);
size_t size = ftell(fp);
fseek(fp, 0, SEEK_SET);
string buf(size, '?');
fread(&buf[0], 1, size, fp);
fclose(fp);
string flag = "fLAG";
flag[0] -= 'a' - 'A';
size_t i = buf.find(flag);
string ans = string(buf.c_str() + i);
puts(ans.c_str());
return 0;
}
anta