QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#399393#6749. TargetszjWA 1ms4156kbC++111.2kb2024-04-26 12:15:362024-04-26 12:15:36

Judging History

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

  • [2024-04-26 12:15:36]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4156kb
  • [2024-04-26 12:15:36]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define IOS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const long double PI = acos(-1);
const ll mod = 998244353;
const int maxn = 1e6 + 7;
const int P = 13331;

ll qgcd(ll a, ll b) {
    return b == 0 ? a : qgcd(b, a % b);
}

ll qpow(ll a, ll b) {
    ll ans = 1;
    while (b) {
        if (b & 1)
            ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans % mod;
}

double a, b;
int x, y;
int d[maxn];
vector<int> v;
int flag;

void dfs(int z) {
	if (d[z])
		return;
	d[z] = 1;
	if (z == y) {
		for (auto i: v) {
			cout << i;
		}
		flag = 1;
	}
	if (flag)
		return;
	if (d[z / 2] == 0 && v.size() < 50) {
		v.push_back(1);
		dfs(z / 2);
		v.pop_back();
	}
		
	if (flag == 0 && d[(z - 100000) / 2 + 100000] == 0 && v.size() < 50) {
		v.push_back(2);
		dfs((z - 100000) / 2 + 100000);
		v.pop_back();
	}
}

void solve() {
	cin >> a >> b;
	x = a * 100000;
	y = b * 100000;
	dfs(x);
}

int main() {
//    IOS;
    int T = 1;
//    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}

/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3828kb

input:

0.5 0.25

output:

1

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 4080kb

input:

1 0.75

output:

12

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

1 0

output:

11111111111111111

result:

ok ok

Test #4:

score: 0
Accepted
time: 1ms
memory: 4156kb

input:

0.361954 0.578805

output:

111111111111111121111111111111122121111212112

result:

ok ok

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 4080kb

input:

0.144888 0.140086

output:


result:

wrong answer wa