結果

問題 No.5006 Hidden Maze
ユーザー wanuiwanui
提出日時 2022-06-12 16:41:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 3,297 bytes
コンパイル時間 2,062 ms
実行使用メモリ 22,856 KB
スコア 0
平均クエリ数 1000.00
最終ジャッジ日時 2022-06-12 16:41:39
合計ジャッジ時間 11,180 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
純コード判定しない問題か言語
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
21,908 KB
testcase_01 AC 44 ms
21,940 KB
testcase_02 AC 45 ms
21,952 KB
testcase_03 AC 46 ms
22,620 KB
testcase_04 AC 46 ms
21,904 KB
testcase_05 AC 45 ms
21,792 KB
testcase_06 AC 45 ms
22,432 KB
testcase_07 AC 45 ms
21,928 KB
testcase_08 AC 45 ms
21,952 KB
testcase_09 AC 45 ms
21,992 KB
testcase_10 AC 50 ms
21,964 KB
testcase_11 AC 49 ms
21,964 KB
testcase_12 AC 48 ms
21,892 KB
testcase_13 AC 44 ms
21,756 KB
testcase_14 AC 46 ms
22,132 KB
testcase_15 AC 44 ms
21,768 KB
testcase_16 AC 48 ms
21,980 KB
testcase_17 AC 44 ms
22,276 KB
testcase_18 AC 46 ms
21,928 KB
testcase_19 AC 45 ms
21,940 KB
testcase_20 AC 46 ms
22,016 KB
testcase_21 AC 47 ms
21,904 KB
testcase_22 AC 46 ms
22,620 KB
testcase_23 AC 46 ms
21,952 KB
testcase_24 AC 44 ms
21,768 KB
testcase_25 AC 44 ms
22,228 KB
testcase_26 AC 44 ms
22,600 KB
testcase_27 AC 46 ms
21,836 KB
testcase_28 AC 47 ms
22,432 KB
testcase_29 AC 49 ms
21,904 KB
testcase_30 AC 49 ms
21,952 KB
testcase_31 AC 46 ms
22,620 KB
testcase_32 AC 48 ms
21,892 KB
testcase_33 AC 47 ms
22,704 KB
testcase_34 AC 47 ms
22,288 KB
testcase_35 AC 46 ms
21,980 KB
testcase_36 AC 46 ms
22,216 KB
testcase_37 AC 45 ms
21,952 KB
testcase_38 AC 45 ms
22,588 KB
testcase_39 AC 47 ms
22,552 KB
testcase_40 AC 48 ms
21,904 KB
testcase_41 AC 46 ms
22,728 KB
testcase_42 AC 47 ms
22,612 KB
testcase_43 AC 46 ms
22,552 KB
testcase_44 AC 44 ms
21,992 KB
testcase_45 AC 44 ms
22,620 KB
testcase_46 AC 48 ms
21,780 KB
testcase_47 AC 48 ms
21,952 KB
testcase_48 AC 49 ms
22,252 KB
testcase_49 AC 46 ms
21,940 KB
testcase_50 AC 49 ms
21,940 KB
testcase_51 AC 47 ms
22,588 KB
testcase_52 AC 46 ms
21,768 KB
testcase_53 AC 45 ms
22,444 KB
testcase_54 AC 44 ms
21,992 KB
testcase_55 AC 45 ms
21,952 KB
testcase_56 AC 46 ms
21,904 KB
testcase_57 AC 45 ms
22,612 KB
testcase_58 AC 44 ms
21,940 KB
testcase_59 AC 44 ms
21,904 KB
testcase_60 AC 45 ms
22,264 KB
testcase_61 AC 44 ms
21,940 KB
testcase_62 AC 47 ms
21,980 KB
testcase_63 AC 46 ms
21,904 KB
testcase_64 AC 47 ms
21,940 KB
testcase_65 AC 44 ms
22,288 KB
testcase_66 AC 44 ms
22,004 KB
testcase_67 AC 45 ms
22,432 KB
testcase_68 AC 46 ms
22,612 KB
testcase_69 AC 50 ms
22,856 KB
testcase_70 AC 50 ms
21,904 KB
testcase_71 AC 47 ms
21,940 KB
testcase_72 AC 44 ms
22,632 KB
testcase_73 AC 45 ms
22,276 KB
testcase_74 AC 45 ms
22,588 KB
testcase_75 AC 44 ms
21,904 KB
testcase_76 AC 47 ms
22,612 KB
testcase_77 AC 44 ms
21,892 KB
testcase_78 AC 46 ms
22,600 KB
testcase_79 AC 44 ms
21,892 KB
testcase_80 AC 44 ms
21,892 KB
testcase_81 AC 45 ms
22,228 KB
testcase_82 AC 45 ms
21,756 KB
testcase_83 AC 44 ms
21,904 KB
testcase_84 AC 43 ms
21,892 KB
testcase_85 AC 45 ms
21,892 KB
testcase_86 AC 45 ms
21,792 KB
testcase_87 AC 46 ms
21,880 KB
testcase_88 AC 48 ms
21,992 KB
testcase_89 AC 47 ms
22,716 KB
testcase_90 AC 46 ms
22,004 KB
testcase_91 AC 48 ms
21,928 KB
testcase_92 AC 48 ms
21,916 KB
testcase_93 AC 47 ms
21,916 KB
testcase_94 AC 47 ms
21,952 KB
testcase_95 AC 46 ms
22,588 KB
testcase_96 AC 47 ms
22,444 KB
testcase_97 AC 47 ms
21,768 KB
testcase_98 AC 48 ms
22,444 KB
testcase_99 AC 46 ms
22,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair<ll,ll>; const ll INF=4e18;
void print0(){}; template<typename H,typename... T> void print0(H h,T... t){cout<<h;print0(t...);}
void print(){print0("\n");}; template<typename H,typename... T>void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);}
void perr0(){}; template<typename H,typename... T> void perr0(H h,T... t){cerr<<h;perr0(t...);}
void perr(){perr0("\n");}; template<typename H,typename... T>void perr(H h,T... t){perr0(h);if(sizeof...(T)>0)perr0(" ");perr(t...);}
void ioinit() { cout<<fixed<<setprecision(15); cerr<<fixed<<setprecision(6); ios_base::sync_with_stdio(0); cin.tie(0); }
// clang-format on
using pii = pair<int, int>;
using tii = tuple<int, int, int>;

struct point {
    int i;
    int j;
};
bool operator==(const point &lhs, const point &rhs) { return (lhs.i == rhs.i && lhs.j == rhs.j); }
bool operator!=(const point &lhs, const point &rhs) { return !(lhs == rhs); }
bool operator<(const point &lhs, const point &rhs) {
    if (lhs.i != rhs.i) {
        return lhs.i < rhs.i;
    }
    return lhs.j < rhs.j;
}
std::ostream &operator<<(std::ostream &os, point &pt) {
    string s;
    s.push_back('(');
    s = s + to_string(pt.i);
    s = s + ", ";
    s = s + to_string(pt.j);
    s.push_back(')');
    return os << s;
}

mt19937 engine(0);
clock_t start_time;
double now() {
    return 1000.0 * (clock() - start_time) / CLOCKS_PER_SEC;
}
void marathon_init() {
    start_time = clock();
    random_device seed_gen;
    engine.seed(seed_gen());
}
int randint(int mn, int mx) {
    int rng = mx - mn + 1;
    return mn + (engine() % rng);
}
double uniform(double x, double y) {
    const int RND = 1e8;
    double mean = (x + y) / 2.0;
    double dif = y - mean;
    double p = double(engine() % RND) / RND;
    return mean + dif * (1.0 - 2.0 * p);
}
bool anneal_accept(double new_score, double old_score, double cur_time, double begin_time, double end_time, double begin_temp, double end_temp) {
    const int ANNEAL_RND = 1e8;
    const double ANNEAL_EPS = 1e-6;
    double temp = cur_time * (end_temp - begin_temp) / (end_time - begin_time) + (end_time * begin_temp - end_temp * begin_time) / (end_time - begin_time);
    return (exp((new_score - old_score) / temp) > double(engine() % ANNEAL_RND) / ANNEAL_RND + ANNEAL_EPS);
}

const int N = 20;
const int OPS = 1000;

double P;
const int R = 0;
const int D = 1;
const int L = 2;
const int U = 3;
vector<point> mvs = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
int request(string ops) {
    cout << ops << endl;
    int res;
    cin >> res;
    return res;
}
string makeop(int opid, vector<pair<int, string>> &history) {
    string s = "RDRDRD";
    return s;
}
void solve() {
    int opslimit = OPS;
    opslimit = 1000;

    int maxres = 0;
    vector<pair<int, string>> history;
    for (int opid = 0; opid < opslimit; opid++) {
        string s = makeop(opid, history);
        int res = request(s);
        if (res < 0) {
            return;
        }
        history.push_back({res, s});
        maxres = max(maxres, res);
    }
}
int main() {
    marathon_init();
    ioinit();
    int _h, _w;
    cin >> _h >> _w >> P;
    P *= 0.01;
    solve();
    return 0;
}
0