parent
13ad957f39
commit
68f70cbda0
@ -1,22 +1,22 @@
|
||||
// https://www.luogu.com.cn/problem/solution/B3925
|
||||
#include <iostream>
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
int main() {
|
||||
long long n, i, j, k;
|
||||
cin >> n >> i;
|
||||
for (j = 1;; j++) {
|
||||
bool flag = true;
|
||||
long long ans = j * n + i;
|
||||
for (k = 1; k < n; k++) {
|
||||
if (ans % (n - 1)) {
|
||||
flag = false;
|
||||
int i = 0, j = 0;
|
||||
int x, n;
|
||||
cin >> n >> x;
|
||||
int tmp = 0;
|
||||
for (i = 1; i <= 100000000; i++) {
|
||||
tmp = i;
|
||||
for (j = 0; j < n; j++) {
|
||||
if ((tmp - x) % n != 0 || tmp <= x)
|
||||
break;
|
||||
}
|
||||
ans = ans / (n - 1) * n + i;
|
||||
tmp = (tmp - x) / n * (n-1);
|
||||
}
|
||||
if (flag) {
|
||||
cout << ans;
|
||||
return 0;
|
||||
if (j == n) {
|
||||
printf("%d\n", i);
|
||||
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