Submission #60544331
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;#define int long longsigned main(){ios::sync_with_stdio(0);cin.tie(0);long long n;cin>>n;bool test[2000100]={false};test[0]=true;test[1]=true;vector<long long> prime;for(int i=2;i<=2000000;i++){if(test[i]==false){prime.push_back(i*i);for(int j=i;j*i<=2000050;j++){test[j*i]=true;}}}
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { ios::sync_with_stdio(0); cin.tie(0); long long n; cin>>n; bool test[2000100]={false}; test[0]=true; test[1]=true; vector<long long> prime; for(int i=2;i<=2000000;i++){ if(test[i]==false){ prime.push_back(i*i); for(int j=i;j*i<=2000050;j++){ test[j*i]=true; } } } prime.push_back(4000000000000); int ans=0; for(int i=0;i<prime.size();i++){ double temp=n/prime[i]; auto it=upper_bound(prime.begin(),prime.end(),temp)-prime.begin(); if(it<=i){ continue; } ans+=(it-i-1); } cout<<ans; }
Submission Info
Submission Time | |
---|---|
Task | D - 9 Divisors |
User | fredy |
Language | C++ 23 (Clang 16.0.6) |
Score | 0 |
Code Size | 782 Byte |
Status | WA |
Exec Time | 12 ms |
Memory | 7220 KB |
Compile Error
./Main.cpp:24:18: warning: comparison of integers of different signs: 'long long' and 'size_type' (aka 'unsigned long') [-Wsign-compare] for(int i=0;i<prime.size();i++){ ~^~~~~~~~~~~~~ 1 warning generated.
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 12 ms | 7192 KB |
00_sample_02.txt | WA | 12 ms | 7116 KB |
01_test_01.txt | AC | 11 ms | 7220 KB |
01_test_02.txt | AC | 11 ms | 7140 KB |
01_test_03.txt | AC | 11 ms | 7124 KB |
01_test_04.txt | AC | 11 ms | 7108 KB |
01_test_05.txt | AC | 11 ms | 7216 KB |
01_test_06.txt | WA | 11 ms | 7080 KB |
01_test_07.txt | WA | 12 ms | 7128 KB |
01_test_08.txt | WA | 11 ms | 7180 KB |
01_test_09.txt | WA | 12 ms | 7220 KB |
01_test_10.txt | WA | 12 ms | 7088 KB |
01_test_11.txt | WA | 12 ms | 7076 KB |
01_test_12.txt | WA | 12 ms | 7192 KB |
01_test_13.txt | WA | 12 ms | 7076 KB |
01_test_14.txt | WA | 11 ms | 7188 KB |
01_test_15.txt | WA | 12 ms | 7140 KB |
01_test_16.txt | WA | 12 ms | 7188 KB |
01_test_17.txt | WA | 11 ms | 6956 KB |
01_test_18.txt | WA | 12 ms | 7164 KB |
01_test_19.txt | WA | 11 ms | 7000 KB |
01_test_20.txt | WA | 12 ms | 7060 KB |
01_test_21.txt | AC | 12 ms | 7112 KB |
01_test_22.txt | AC | 11 ms | 7108 KB |
01_test_23.txt | AC | 12 ms | 7192 KB |
01_test_24.txt | WA | 12 ms | 7140 KB |
01_test_25.txt | WA | 11 ms | 7184 KB |
01_test_26.txt | WA | 12 ms | 7196 KB |
01_test_27.txt | WA | 12 ms | 7052 KB |
01_test_28.txt | WA | 12 ms | 7180 KB |
01_test_29.txt | WA | 12 ms | 7088 KB |
01_test_30.txt | WA | 11 ms | 7192 KB |
01_test_31.txt | WA | 12 ms | 7112 KB |
01_test_32.txt | WA | 12 ms | 7072 KB |