'commit'
This commit is contained in:
27
LuoGu/RuMen/P1851.cpp
Normal file
27
LuoGu/RuMen/P1851.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int s;
|
||||
cin >> s;
|
||||
for (int i = s;; i++) {
|
||||
int a = 0, b = 0, a1 = 0, b1 = 0;
|
||||
a = i;
|
||||
for (int j = 1; j <= sqrt(a); j++) {
|
||||
if (a % j == 0) a1 = a1 + j + a / j;
|
||||
}
|
||||
a1 = a1 - a;
|
||||
|
||||
b = a1;
|
||||
for (int j = 1; j <= sqrt(b); j++) {
|
||||
if (b % j == 0) b1 = b1 + j + b / j;
|
||||
}
|
||||
b1 = b1 - b;
|
||||
|
||||
if (a == b1 && a >= s && a != b) {
|
||||
cout << a << " " << b;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user