parent
13ad957f39
commit
68f70cbda0
@ -1,22 +1,22 @@
|
|||||||
// https://www.luogu.com.cn/problem/solution/B3925
|
#include <bits/stdc++.h>
|
||||||
#include <iostream>
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int main() {
|
int main() {
|
||||||
long long n, i, j, k;
|
int i = 0, j = 0;
|
||||||
cin >> n >> i;
|
int x, n;
|
||||||
for (j = 1;; j++) {
|
cin >> n >> x;
|
||||||
bool flag = true;
|
int tmp = 0;
|
||||||
long long ans = j * n + i;
|
for (i = 1; i <= 100000000; i++) {
|
||||||
for (k = 1; k < n; k++) {
|
tmp = i;
|
||||||
if (ans % (n - 1)) {
|
for (j = 0; j < n; j++) {
|
||||||
flag = false;
|
if ((tmp - x) % n != 0 || tmp <= x)
|
||||||
break;
|
break;
|
||||||
}
|
tmp = (tmp - x) / n * (n-1);
|
||||||
ans = ans / (n - 1) * n + i;
|
|
||||||
}
|
}
|
||||||
if (flag) {
|
if (j == n) {
|
||||||
cout << ans;
|
printf("%d\n", i);
|
||||||
return 0;
|
exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("thats too more!");
|
||||||
|
return 0;
|
||||||
}
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
// https://blog.csdn.net/weixin_43772810/article/details/121048802
|
||||||
|
// https://blog.csdn.net/weixin_43772810/article/details/121297946
|
||||||
|
using namespace std;
|
||||||
|
int main() {
|
||||||
|
int i = 0, j = 0;
|
||||||
|
int tmp = 0;
|
||||||
|
for (i = 1; i <= 10000; i++) {
|
||||||
|
tmp = i;
|
||||||
|
for (j = 0; j < 5; j++) {
|
||||||
|
if ((tmp - 1) % 5 != 0 || tmp <= 1)
|
||||||
|
break;
|
||||||
|
tmp = (tmp - 1) / 5 * 4;
|
||||||
|
}
|
||||||
|
if (j == 5) {
|
||||||
|
printf("there was %d peaches.\n", i);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("thats too more!");
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in new issue