Submission #64548883


Source Code Expand

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define ld long double
#define int long long
#define nl "\n"
#define oo 1e9 + 1
#define OO 1e18 + 1
#define sp ' '
#define sz(x) (int)(x.size())
#define MOD 1000000007
#define fixed(n) fixed << setprecision(n)
#define sub_mod(a, b, m) ((((a) % m) - ((b) % m) + m) % m)
#define add_mod(a, b, m) ((((a) % m) + ((b) % m)) % m)
#define mult_mod(a, b, m) ((((a) % m) * ((b) % m)) % m)
#define EPS 1e-9
#define PI acos(-1)
using namespace __gnu_pbds;
using namespace std;
int sol1(int n){
    int ans = 0;
    ans += sqrtl(n / 2);
    ans += sqrtl(n / 4);
    return ans;
}
int sol2(int n){
    int ans = 0;
    for (int i = 1; i <= n; i++){
        for (int j = 1; j < 32; j++){
            if(i % (1 << j))
                break;
            int val = sqrt(i / (1 << j));
            if(val * val == i / (1 << j)){
                ans++;
                break;
            }
        }
    }
    return ans;
}
void solve(int tc)
{
    int n;
    cin >> n;
    cout << sol1(n) << nl;
}
signed main(void)
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    int tc = 1;
    //cin >> tc;
    int i = 1000000;
    while (tc--)
    {
        // cout<<"Case #"<<i<<": ";
        solve(i++);
    }
    return 0;
}

Submission Info

Submission Time
Task C - 2^a b^2
User Mazen_Ghanayem
Language C++ 23 (gcc 12.2)
Score 350
Code Size 1444 Byte
Status AC
Exec Time 1 ms
Memory 3608 KiB

Compile Error

Main.cpp: In function ‘void solve(long long int)’:
Main.cpp:43:16: warning: unused parameter ‘tc’ [-Wunused-parameter]
   43 | void solve(int tc)
      |                ^

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 3452 KiB
example_01.txt AC 1 ms 3492 KiB
example_02.txt AC 1 ms 3424 KiB
hand_00.txt AC 1 ms 3456 KiB
hand_01.txt AC 1 ms 3460 KiB
hand_02.txt AC 1 ms 3440 KiB
hand_03.txt AC 1 ms 3524 KiB
hand_04.txt AC 1 ms 3484 KiB
hand_05.txt AC 1 ms 3428 KiB
hand_06.txt AC 1 ms 3528 KiB
hand_07.txt AC 1 ms 3560 KiB
hand_08.txt AC 1 ms 3556 KiB
hand_09.txt AC 1 ms 3384 KiB
hand_10.txt AC 1 ms 3424 KiB
random_00.txt AC 1 ms 3472 KiB
random_01.txt AC 1 ms 3456 KiB
random_02.txt AC 1 ms 3404 KiB
random_03.txt AC 1 ms 3428 KiB
random_04.txt AC 1 ms 3460 KiB
random_05.txt AC 1 ms 3456 KiB
random_06.txt AC 1 ms 3376 KiB
random_07.txt AC 1 ms 3520 KiB
random_08.txt AC 1 ms 3560 KiB
random_09.txt AC 1 ms 3472 KiB
random_10.txt AC 1 ms 3460 KiB
random_11.txt AC 1 ms 3400 KiB
random_12.txt AC 1 ms 3608 KiB
random_13.txt AC 1 ms 3396 KiB
random_14.txt AC 1 ms 3528 KiB