QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409259#6749. Targetundefined-ux#WA 1ms3560kbC++14862b2024-05-11 20:55:532024-05-11 20:55:53

Judging History

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

  • [2024-05-11 20:55:53]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3560kb
  • [2024-05-11 20:55:53]
  • 提交

answer

#include <bits/stdc++.h>
#define qio std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
using namespace std;
const int N = 1e5 + 20;
typedef pair<int, int> PII;
typedef struct {
    long long a;  string path;
} Node;

long long a, b;

void solve(queue<Node>& q) {
    while(!q.empty()) {
        auto now = q.front(); q.pop();
        if(abs(now.a - b) <= 1) {
            cout << now.path << endl;
            return ;
        }
        if(now.path.size() >= 50) continue;
        if(now.a >= b) q.push({now.a / 2, now.path + "1"});
        if(now.a <= b) q.push({(now.a - 10000) / 2 + 10000, now.path + "2"});
    }
}

int main() { qio
    int  t = 1;

    while(t--) {
        queue<Node> q;
        cin >> a >> b;
        b *= 1e4;
        q.push({a * (1e4), ""});
        solve(q);
    }

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3560kb

input:

0.5 0.25

output:



result:

wrong answer wa