QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#593472#6558. Allergen Testingticking_away#TL 0ms3644kbC++201.4kb2024-09-27 14:16:262024-09-27 14:16:26

Judging History

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

  • [2024-09-27 14:16:26]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3644kb
  • [2024-09-27 14:16:26]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ui = unsigned int;
using ull = unsigned long long;
using ll = long long;
#define endl '\n'
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int maxn = 2e5 + 10;
const int mod = 1000000007;
#define inl inline
#define fr(i, a, b) for (int i = a; i <= b; i++)
#define ford(i, a, b) for (int i = a; i >= b; i--)
#define forall(i, a) for (auto &i : a)

/**
   ____         ___ _____
  / ___| _   _ / _ \___ /
  \___ \| | | | | | ||_ \
   ___) | |_| | |_| |__) |
  |____/ \__, |\___/____/
         |___/
*/
istream &operator>>(istream &in, vector<int> &v)
{
    for (auto &i : v)
        in >> i;
    return in;
}
ostream &operator<<(ostream &out, vector<int> &v)
{
    for (auto &i : v)
        out << i << " ";
    return out;
}
bool _output = 1;

#define int ll
void solve()
{
    int n, d;
    cin >> n >> d;
    auto get = [&](int n, int k)
    {
        int cnt = 0;
        int now = 1;
        while (now < n)
        {
            now *= k;
            cnt++;
        }
        return cnt;
    };
    int ans = get(n, d + 1);

    cout << ans << endl;
    assert(1);
}

// 十字

// 4条
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    if (_output)
        cin >> _;
    while (_--)
        solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
4 1

output:

2

result:

ok single line: '2'

Test #2:

score: -100
Time Limit Exceeded

input:

10000
1 1
1000000000000000000 1
1 1000000000000000000
1000000000000000000 1000000000000000000
26615519354743225 163142634
26615519354743225 163142634
26615519354743224 163142634
26615519354743226 163142634
847997831064072529 920867976
847997831064072529 920867976
847997831064072528 920867976
8479978...

output:


result: