Submission #64536940


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define fs first
#define sd second
#define int long long
const int mod = 1e9 + 7;

int powOf(int l, int r)
{
    int c = 0;
    while (l > 0 && l % r == 0)
    {
        l /= r;
        c++;
    }
    return c;
}

int binpow(int n, int x)
{
    if (x == 0)
        return 1;
    int ans = binpow(n, x / 2);
    if (x % 2 == 0)
        return ans * ans;
    else
        return ans * ans * n;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
    // cin >> t;
    while (t--)
    {
        int n;
        cin >> n;
        int ans = 0;
        for (int i = 2; i <= n; i *= 2)
        {
            int sq = n / i;
            int cntb = sqrt(sq);
            for (int j = 1; j <= cntb; j += 2)
            {
                int k = i * j * j;
                if (k <= n)
                    ans++;
                else
                    break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}

Submission Info

Submission Time
Task C - 2^a b^2
User yashr29
Language C++ 20 (gcc 12.2)
Score 350
Code Size 1065 Byte
Status AC
Exec Time 763 ms
Memory 3620 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 350 / 350
Status
AC × 3
AC × 29
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3532 KiB
example_01.txt AC 1 ms 3536 KiB
example_02.txt AC 1 ms 3412 KiB
hand_00.txt AC 1 ms 3480 KiB
hand_01.txt AC 1 ms 3492 KiB
hand_02.txt AC 1 ms 3424 KiB
hand_03.txt AC 763 ms 3412 KiB
hand_04.txt AC 762 ms 3348 KiB
hand_05.txt AC 762 ms 3344 KiB
hand_06.txt AC 762 ms 3436 KiB
hand_07.txt AC 762 ms 3552 KiB
hand_08.txt AC 74 ms 3532 KiB
hand_09.txt AC 74 ms 3480 KiB
hand_10.txt AC 73 ms 3472 KiB
random_00.txt AC 1 ms 3416 KiB
random_01.txt AC 1 ms 3420 KiB
random_02.txt AC 1 ms 3424 KiB
random_03.txt AC 1 ms 3480 KiB
random_04.txt AC 1 ms 3492 KiB
random_05.txt AC 761 ms 3484 KiB
random_06.txt AC 762 ms 3392 KiB
random_07.txt AC 762 ms 3424 KiB
random_08.txt AC 761 ms 3468 KiB
random_09.txt AC 762 ms 3348 KiB
random_10.txt AC 552 ms 3620 KiB
random_11.txt AC 295 ms 3480 KiB
random_12.txt AC 223 ms 3352 KiB
random_13.txt AC 454 ms 3552 KiB
random_14.txt AC 29 ms 3424 KiB