QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#362060 | #6747. Permutation | Urtusea | WA | 1ms | 3772kb | C++23 | 1.6kb | 2024-03-23 14:00:41 | 2024-03-23 14:00:44 |
Judging History
answer
// #define _FILE_IO_
// #define _MULTI_TEST_
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/trie_policy.hpp>
using namespace std;
template <typename T>
using asc_queue = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <typename T>
using des_queue = std::priority_queue<T, std::vector<T>, std::less<T>>;
template <typename key_type>
using order_set = __gnu_pbds::tree<
key_type, __gnu_pbds::null_type, std::less<key_type>,
__gnu_pbds::rb_tree_tag,
__gnu_pbds::tree_order_statistics_node_update
>;
template <typename key_type, typename value_type>
using order_map = __gnu_pbds::tree<
key_type, value_type, std::less<key_type>,
__gnu_pbds::rb_tree_tag,
__gnu_pbds::tree_order_statistics_node_update
>;
using Int = long long;
using pii = pair<int, int>;
using pII = pair<Int, Int>;
constexpr double eps = 1e-4;
void solve()
{
double a, b;
cin >> a >> b;
while (abs(a - b) > eps) {
if (a > b) {
int t = ceil(log2(a / max(b, eps)));
a = a * pow(0.5, t);
cout << string(t, '1');
} else {
a = (a - 1) / 2 + 1;
cout << 2;
}
}
}
int main(const int argc, const char *argv[], const char *envp[])
{
cin.tie(nullptr)->ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
#ifdef _FILE_IO_
freopen("a.in", "r", stdin);
freopen("a.out", "w", stdout);
#endif
int test_case = 1;
#ifdef _MULTI_TEST_
cin >> test_case;
#endif
while (test_case--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3772kb
input:
3
output:
111111111111111
result:
wrong output format Expected int32, but "111111111111111" found