This commit is contained in:
James 2020-05-01 19:44:56 +08:00
parent f306443f78
commit 7755423390
9 changed files with 58 additions and 0 deletions

3
2757_num_apbit/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

View File

@ -0,0 +1 @@
#

Binary file not shown.

33
2757_num_apbit/main.cpp Normal file
View File

@ -0,0 +1,33 @@
#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;
}

BIN
2757_num_apbit/main.exe Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
10

View File

@ -0,0 +1 @@
20

View File

@ -0,0 +1 @@
50

View File

@ -0,0 +1,18 @@
## z:\Chao\src\2757_num_apbit\test\in.txt
2020/05/01 ÖÜÎå 19:19:47.36
6
-----------------------------------------------
Process exited after 160 ms with return value 0
## z:\Chao\src\2757_num_apbit\test\in2.txt
2020/05/01 ÖÜÎå 19:19:47.36
12
-----------------------------------------------
Process exited after 100 ms with return value 0
## z:\Chao\src\2757_num_apbit\test\in3.txt
2020/05/01 ÖÜÎå 19:19:47.36
48
-----------------------------------------------
Process exited after 90 ms with return value 0