diff --git a/GESP/20231201.cpp b/GESP/20231201.cpp index f3e63ea..6ada647 100644 --- a/GESP/20231201.cpp +++ b/GESP/20231201.cpp @@ -1,22 +1,22 @@ -// https://www.luogu.com.cn/problem/solution/B3925 -#include +#include 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; } \ No newline at end of file diff --git a/GESP/WuHouZiFenTao.cpp b/GESP/WuHouZiFenTao.cpp new file mode 100644 index 0000000..7946a2d --- /dev/null +++ b/GESP/WuHouZiFenTao.cpp @@ -0,0 +1,22 @@ +#include +// 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; +} \ No newline at end of file