Submission #3874238


Source Code Expand

#include <bits/stdc++.h>
 
#define Max 100000
 
using namespace std;
 
bool check[Max];
int Prime[Max];

void get_prime(){
    int k = 0;
    check[0] = true;
    check[1] = true;
    for(int i = 2; i < Max; i++){
        if(!check[i]){
            Prime[k++] = i;
        }
        for(int j = i+i; j < Max; j += i){
            check[j] = true;
        }
    }
}
 
int DividInPrime(int num){
    int k = 0;
    for(int i = 0; pow(Prime[i], 2) <= num; i++) {
        while (num % Prime[i] == 0){
            num /= Prime[i];
            k++;
        }
    }
    if (num != 1) {
      k++;
    }
    return k;
}
 
int main() {
    get_prime();
    int l, r;
    cin >> l >> r;
    int ans = 0;
    for(int i = l; i <= r; i++){
      if(!check[DividInPrime(i)]) {
        ans++;
      }
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task C - Prime-Factor Prime
User burgundyernie
Language C++14 (GCC 5.4.1)
Score 0
Code Size 881 Byte
Status TLE
Exec Time 2103 ms
Memory 384 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 53
TLE × 6
Set Name Test Cases
All 00_sample_00, 00_sample_01, 00_sample_02, 00_sample_03, 00_sample_04, 00_sample_05, 10_small_00, 10_small_01, 10_small_02, 10_small_03, 10_small_04, 10_small_05, 10_small_06, 10_small_07, 10_small_08, 10_small_09, 20_medium_00, 20_medium_01, 20_medium_02, 20_medium_03, 20_medium_04, 20_medium_05, 20_medium_06, 20_medium_07, 20_medium_08, 20_medium_09, 30_medium_00, 30_medium_01, 30_medium_02, 30_medium_03, 30_medium_04, 30_medium_05, 30_medium_06, 30_medium_07, 30_medium_08, 30_medium_09, 40_one_00, 40_one_01, 40_one_02, 50_large_low_00, 50_large_low_01, 50_large_low_02, 50_large_low_03, 50_large_low_04, 60_large_high_00, 60_large_high_01, 60_large_high_02, 60_large_high_03, 60_large_high_04, 70_max_low_00, 70_max_low_01, 70_max_low_02, 70_max_low_03, 70_max_low_04, 80_max_high_00, 80_max_high_01, 80_max_high_02, 80_max_high_03, 80_max_high_04
Case Name Status Exec Time Memory
00_sample_00 AC 3 ms 384 KB
00_sample_01 AC 3 ms 384 KB
00_sample_02 AC 9 ms 384 KB
00_sample_03 AC 3 ms 384 KB
00_sample_04 AC 54 ms 384 KB
00_sample_05 TLE 2103 ms 384 KB
10_small_00 AC 3 ms 384 KB
10_small_01 AC 3 ms 384 KB
10_small_02 AC 3 ms 384 KB
10_small_03 AC 3 ms 384 KB
10_small_04 AC 3 ms 384 KB
10_small_05 AC 3 ms 384 KB
10_small_06 AC 3 ms 384 KB
10_small_07 AC 3 ms 384 KB
10_small_08 AC 3 ms 384 KB
10_small_09 AC 3 ms 384 KB
20_medium_00 AC 30 ms 384 KB
20_medium_01 AC 323 ms 384 KB
20_medium_02 AC 188 ms 384 KB
20_medium_03 AC 101 ms 384 KB
20_medium_04 AC 177 ms 384 KB
20_medium_05 AC 87 ms 384 KB
20_medium_06 AC 203 ms 384 KB
20_medium_07 AC 130 ms 384 KB
20_medium_08 AC 200 ms 384 KB
20_medium_09 AC 23 ms 384 KB
30_medium_00 AC 318 ms 384 KB
30_medium_01 AC 163 ms 384 KB
30_medium_02 AC 228 ms 384 KB
30_medium_03 AC 164 ms 384 KB
30_medium_04 AC 318 ms 384 KB
30_medium_05 AC 162 ms 384 KB
30_medium_06 AC 160 ms 384 KB
30_medium_07 AC 85 ms 384 KB
30_medium_08 AC 103 ms 384 KB
30_medium_09 AC 325 ms 384 KB
40_one_00 AC 3 ms 384 KB
40_one_01 AC 3 ms 384 KB
40_one_02 AC 3 ms 384 KB
50_large_low_00 AC 337 ms 384 KB
50_large_low_01 AC 723 ms 384 KB
50_large_low_02 AC 854 ms 384 KB
50_large_low_03 AC 962 ms 384 KB
50_large_low_04 AC 1038 ms 384 KB
60_large_high_00 AC 1067 ms 384 KB
60_large_high_01 AC 994 ms 384 KB
60_large_high_02 AC 871 ms 384 KB
60_large_high_03 AC 795 ms 384 KB
60_large_high_04 AC 610 ms 384 KB
70_max_low_00 AC 684 ms 384 KB
70_max_low_01 AC 1574 ms 384 KB
70_max_low_02 AC 1875 ms 384 KB
70_max_low_03 TLE 2103 ms 384 KB
70_max_low_04 TLE 2103 ms 384 KB
80_max_high_00 TLE 2103 ms 384 KB
80_max_high_01 TLE 2103 ms 384 KB
80_max_high_02 TLE 2011 ms 384 KB
80_max_high_03 AC 1765 ms 384 KB
80_max_high_04 AC 1171 ms 384 KB