QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#406761#6749. Targetpoxiao01Compile Error//Python31.0kb2024-05-07 17:44:432024-05-07 17:44:45

Judging History

你现在查看的是最新测评结果

  • [2024-05-07 17:44:45]
  • 评测
  • [2024-05-07 17:44:43]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define pre(i,x,y) for(int i=x; i>=y; --i)
const int N = 1e5 + 10, M = 4e3 + 10;
const ll INF = 1e17;
#define int long long
const double eps = 1e-4;
bool st[N];

void solve(){
    double a, b;
    cin >> a >> b;
    int sx = a * 10000, sy = b * 10000;
    queue<pair<int, string>> q;
    q.push({sx, ""});

    while(!q.empty()) {
        auto t = q.front();
        q.pop();
        if(t.first == sy) {
            cout << t.second << '\n';
            return;
        }
        int x = t.first * 0.5;
        if(!st[x]) {
            st[x] = true;
            q.push({x, t.second + '1'});
        }
        x = t.first * 0.5 + 0.5 * 10000;
        if(!st[x]) {
            st[x] = true;
            q.push({x, t.second + '2'});
        }
    }
}

signed main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int t = 1;
//    cin >> t;
    while(t --) {
        solve();
    }
}

Details

  File "answer.code", line 2
    using namespace std;
          ^^^^^^^^^
SyntaxError: invalid syntax