mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:11:58 +00:00
#13339. 「NOIP2022模拟赛1111」原题
http://www.nfls.com.cn:10611/submission/238165
This commit is contained in:
parent
57f45d6d0f
commit
28c346cea7
57
NFLSOJ/13339/13339.cpp
Normal file
57
NFLSOJ/13339/13339.cpp
Normal file
@ -0,0 +1,57 @@
|
||||
// #include <iostream>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <fstream>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// using std::cin;
|
||||
// using std::cout;
|
||||
std::ifstream cin("original.in");
|
||||
std::ofstream cout("original.out");
|
||||
const char endl = '\n';
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
long long n, p;
|
||||
std::vector<std::pair<long long, int>> res;
|
||||
|
||||
cin >> n >> p;
|
||||
|
||||
for (long long i = 2; std::pow(i, 3) <= n; i++) {
|
||||
if (n % i == 0) {
|
||||
int cnt = 0;
|
||||
p = p / (i - 1) * i;
|
||||
|
||||
while (n % i == 0) {
|
||||
n /= i;
|
||||
cnt++;
|
||||
p /= i;
|
||||
}
|
||||
|
||||
res.emplace_back(i, cnt);
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 1) {
|
||||
} else if (p == n - 1) {
|
||||
res.emplace_back(n, 1);
|
||||
} else if (std::pow(n - p, 2) == n) {
|
||||
res.emplace_back(n - p, 2);
|
||||
} else {
|
||||
long long a = n - 1 - p,
|
||||
delta = sqrt(a * a - 4 * p);
|
||||
res.emplace_back((a - delta) / 2 + 1, 1);
|
||||
res.emplace_back((a + delta) / 2 + 1, 1);
|
||||
}
|
||||
|
||||
for (auto e : res) {
|
||||
while (e.second--) {
|
||||
cout << e.first << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
NFLSOJ/13339/data/0-original1.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original1.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/0-original1.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/0-original2.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original2.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/0-original2.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/0-original3.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original3.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/0-original3.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/0-original3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original10.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original10.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original10.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original11.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original11.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original11.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original12.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original12.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original12.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original13.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original13.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original13.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original14.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original14.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original14.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original4.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original4.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original4.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original5.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original5.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original5.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original6.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original6.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original6.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original7.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original7.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original7.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original8.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original8.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original8.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original9.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original9.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/1-original9.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/1-original9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original15.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original15.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original15.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original16.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original16.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original16.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original17.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original17.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original17.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original18.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original18.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original18.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original19.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original19.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original19.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original20.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original20.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original20.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original21.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original21.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original21.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original21.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original22.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original22.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original22.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original22.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original23.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original23.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original23.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original23.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original24.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original24.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original24.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original24.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original25.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original25.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original25.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original25.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original26.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original26.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original26.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original26.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original27.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original27.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original27.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original27.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original28.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original28.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original28.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original28.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original29.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original29.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original29.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original29.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original30.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original30.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original30.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original30.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original31.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original31.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original31.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original31.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original32.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original32.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original32.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original32.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original33.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original33.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original33.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original33.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original34.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original34.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original34.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original34.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original35.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original35.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original35.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original35.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original36.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original36.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/2-original36.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/2-original36.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original37.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original37.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original37.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original37.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original38.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original38.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original38.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original38.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original39.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original39.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original39.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original39.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original40.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original40.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original40.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original40.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original41.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original41.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original41.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original41.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original42.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original42.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original42.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original42.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original43.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original43.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original43.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original43.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original44.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original44.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original44.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original44.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original45.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original45.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original45.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original45.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original46.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original46.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original46.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original46.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original47.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original47.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original47.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original47.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original48.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original48.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original48.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original48.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original49.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original49.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original49.in
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original49.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
NFLSOJ/13339/data/3-original50.ans
(Stored with Git LFS)
Normal file
BIN
NFLSOJ/13339/data/3-original50.ans
(Stored with Git LFS)
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user