-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path19_4.cpp
More file actions
35 lines (32 loc) · 809 Bytes
/
Copy path19_4.cpp
File metadata and controls
35 lines (32 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
const int N = 10000001;
int main(){
pair<int ,int> nums[4] = {make_pair(0,0)};
for(int i=1000;i<N;i++){
int k = i;
int zz = 1;
for(int j=2;j<=sqrt(i);j++){
if(k%j==0){
int w = 0;
while(k%j==0)k/=j ,w++;
zz *= w+1;
}
}
int n = i;
for(int j=0;j<4;j++){
if(zz>nums[j].second){
int temp = nums[j].second;
nums[j].second = zz;
zz = temp;
temp = nums[j].first;
nums[j].first = n;
n = temp;
}
}
}
cout << nums[0].first << " " << nums[3].first << endl;
return 0;
}