結果

問題 No.3051 cracked
ユーザー みしあみしあ
提出日時 2021-10-22 13:54:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 431 ms / 1,024 ms
コード長 1,590 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 67,740 KB
実行使用メモリ 24,360 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-30 05:59:36
合計ジャッジ時間 12,273 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 409 ms
23,832 KB
testcase_01 AC 414 ms
23,628 KB
testcase_02 AC 414 ms
23,388 KB
testcase_03 AC 421 ms
24,360 KB
testcase_04 AC 414 ms
23,400 KB
testcase_05 AC 407 ms
23,652 KB
testcase_06 AC 412 ms
23,616 KB
testcase_07 AC 416 ms
23,364 KB
testcase_08 AC 431 ms
24,012 KB
testcase_09 AC 428 ms
23,388 KB
testcase_10 AC 420 ms
23,376 KB
testcase_11 AC 402 ms
23,400 KB
testcase_12 AC 413 ms
24,264 KB
testcase_13 AC 407 ms
23,376 KB
testcase_14 AC 411 ms
24,048 KB
testcase_15 AC 394 ms
23,616 KB
testcase_16 AC 408 ms
23,628 KB
testcase_17 AC 409 ms
24,288 KB
testcase_18 AC 404 ms
23,520 KB
testcase_19 AC 396 ms
23,508 KB
testcase_20 AC 408 ms
24,360 KB
testcase_21 AC 392 ms
23,424 KB
testcase_22 AC 386 ms
23,400 KB
testcase_23 AC 395 ms
23,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
string source="#include <iostream>\n#include <string>\nusing namespace std;\nstring source=\"@\";\nstring replace_all(string str, string c, string r){\n    string ret = \"\";\n    for(char s : str)\n        if(s == c[0]) ret += r;\n        else ret += s;\n    return ret;\n}\nstring build(string str){\n    string ret=str;\n    str=replace_all(str, \"\\\\\", \"\\\\\\\\\");\n    str=replace_all(str, \"\\n\", \"\\\\n\");\n    str=replace_all(str, \"\\\"\", \"\\\\\\\"\");\n    ret=replace_all(ret, \"\\x40\", str);\n    return ret;\n}\nint main(){\n    string str = build(source);\n    for(int i=0; i<str.length(); i++){\n        char c = getchar();\n        if(c != str[i]){\n            cout << i << endl << (char)34 << str[i] << (char)34 << endl << (char)34 << c << (char)34 << endl;\n            break;\n        }\n    }\n    return 0;\n}";
string replace_all(string str, string c, string r){
    string ret = "";
    for(char s : str)
        if(s == c[0]) ret += r;
        else ret += s;
    return ret;
}
string build(string str){
    string ret=str;
    str=replace_all(str, "\\", "\\\\");
    str=replace_all(str, "\n", "\\n");
    str=replace_all(str, "\"", "\\\"");
    ret=replace_all(ret, "\x40", str);
    return ret;
}
int main(){
    string str = build(source);
    for(int i=0; i<str.length(); i++){
        char c = getchar();
        if(c != str[i]){
            cout << i << endl << (char)34 << str[i] << (char)34 << endl << (char)34 << c << (char)34 << endl;
            break;
        }
    }
    return 0;
}
0