Submission #64548185
Source Code Expand
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
long long count_good_integers(long long N) {
long long ans = 0;
set < long long> d;
map <long long , long long > mp;
// Перебираем значения a
for (long long a = 1; (1LL << a) <= N; ++a) { // 1LL << a — это 2^a
long long power_of_two = 1LL << a; // 2^a
long long b = 1;
// Перебираем значения b
while (true) {
long long good_integer = power_of_two * b * b; // X = 2^a * b^2
if (good_integer > N) {
break; // Если X превышает N, выходим из цикла
}
mp[good_integer]++;
if(mp[good_integer] == 1)ans++;
b++; // Переходим к следующему b
}
}
return ans;
}
int main() {
long long N;
cin >> N;
long long result = count_good_integers(N);
cout << result << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - 2^a b^2 |
| User | Yuri_Vilcheuski |
| Language | C++ 17 (gcc 12.2) |
| Score | 0 |
| Code Size | 1034 Byte |
| Status | TLE |
| Exec Time | 2224 ms |
| Memory | 254080 KiB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 350 | ||||||
| Status |
|
|
| 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 | 3476 KiB |
| example_01.txt | AC | 1 ms | 3616 KiB |
| example_02.txt | AC | 16 ms | 6320 KiB |
| hand_00.txt | AC | 1 ms | 3540 KiB |
| hand_01.txt | AC | 1 ms | 3532 KiB |
| hand_02.txt | AC | 1 ms | 3488 KiB |
| hand_03.txt | TLE | 2221 ms | 245100 KiB |
| hand_04.txt | TLE | 2221 ms | 237816 KiB |
| hand_05.txt | TLE | 2221 ms | 237120 KiB |
| hand_06.txt | TLE | 2222 ms | 252488 KiB |
| hand_07.txt | TLE | 2222 ms | 252008 KiB |
| hand_08.txt | TLE | 2224 ms | 243980 KiB |
| hand_09.txt | TLE | 2221 ms | 254080 KiB |
| hand_10.txt | TLE | 2221 ms | 253496 KiB |
| random_00.txt | AC | 5 ms | 4484 KiB |
| random_01.txt | AC | 13 ms | 5772 KiB |
| random_02.txt | AC | 11 ms | 5376 KiB |
| random_03.txt | AC | 2 ms | 3868 KiB |
| random_04.txt | AC | 13 ms | 5700 KiB |
| random_05.txt | TLE | 2221 ms | 242776 KiB |
| random_06.txt | TLE | 2221 ms | 239168 KiB |
| random_07.txt | TLE | 2221 ms | 241216 KiB |
| random_08.txt | TLE | 2221 ms | 246132 KiB |
| random_09.txt | TLE | 2221 ms | 243864 KiB |
| random_10.txt | TLE | 2221 ms | 251252 KiB |
| random_11.txt | TLE | 2221 ms | 239028 KiB |
| random_12.txt | TLE | 2222 ms | 249704 KiB |
| random_13.txt | TLE | 2221 ms | 238172 KiB |
| random_14.txt | TLE | 2221 ms | 238480 KiB |