QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#362060#6747. PermutationUrtuseaWA 1ms3772kbC++231.6kb2024-03-23 14:00:412024-03-23 14:00:44

Judging History

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

  • [2024-03-23 14:00:44]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3772kb
  • [2024-03-23 14:00:41]
  • 提交

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;
}

詳細信息

Test #1:

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

input:

3

output:

111111111111111

result:

wrong output format Expected int32, but "111111111111111" found