34 lines
717 B
C++
34 lines
717 B
C++
|
#include <cmath>
|
||
|
#include <cstring>
|
||
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
int n;
|
||
|
cin >> n;
|
||
|
int a[1001] = { 0 };
|
||
|
for (int i = 1; i <= n; i++) {
|
||
|
int len = sqrt(i);
|
||
|
for (int j = 1; j <= len; j++) {
|
||
|
if (i / j == 0) {
|
||
|
break;
|
||
|
}
|
||
|
if (i % j == 0) {
|
||
|
a[i] += 2;
|
||
|
if (j == i/j) {
|
||
|
a[i]--;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
int ans = 0;
|
||
|
for (int i = 1; i <= n; i++) {
|
||
|
//cout << i << " " << a[i] << "\n";
|
||
|
if (a[ans] < a[i]) {
|
||
|
//cout << "\n";
|
||
|
ans = i;
|
||
|
}
|
||
|
}
|
||
|
cout << ans;
|
||
|
}
|