I've participated to SEERC 2025. Is there or will there be a mirror for SEERC 2025? Also is there a way to find my in-contest submissions? I don't know any codeforces name of judges but you may tag them if you know and you are curious too.
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 144 |
| 5 | errorgorn | 141 |
| 6 | cry | 139 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
I've participated to SEERC 2025. Is there or will there be a mirror for SEERC 2025? Also is there a way to find my in-contest submissions? I don't know any codeforces name of judges but you may tag them if you know and you are curious too.
Hi eveyone!
This is the first blog and the first problem that I wrote. I will share the problem and some different approaches to solve it. If you want to try it first, here is the statement:
There are $$$N$$$ children in a circle. During the game, every other child is removed from the circle until there are no children left (classic Josephus Problem). The order of removals creates a permutation of $$$N$$$ and lets call that $$$p$$$. I want you to find for all $$$i$$$ such that $$$1 \leq i \leq N$$$ and $$$p_i = i$$$. Print them in increasing order. If there is no such a number print $$$-1$$$. For example for $$$N = 7$$$ the permutation is $$$p = {2, 4, 6, 1, 5, 3, 7}$$$. 5th number is 5 and 7th number is 7 so you should print 5 7. There is also $$$T$$$ test cases.
$$$1 \leq T \leq 2 * 10^5$$$
$$$1 \leq N \leq 10^9$$$
I couldn't figure it out but then I've find a solution by looking the answer patterns. I still have no clue why it is like that but here is my code and explanation. I'm sure both solutions are correct, I've checked them with a slower time complexity bruteforce way.
Idea: olasiliksizci
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t; cin >> t;
while (t--) {
int n; cin >> n;
vector<int> ans;
for (int i = 1; (1LL << i) <= 2 * n; i++) {
int j = i + 1, i2 = 1LL << i, j2 = 1LL << j;
if ((n + i2) % (j2 - 1) == 0) { // (n + i2) / (j2 - 1) == x
ans.push_back(((n + i2) / (j2 - 1)) * (j2 - 2) - i2 + 1);
}
}
if (ans.empty()) cout << -1;
for (auto& i : ans) cout << i << ' ';
cout << '\n';
}
return 0;
}
I don't have a proof for that but it works like this: If number $$$N$$$ can be written as $$$(2^{k + 1} - 1)x - 2^k$$$ Then this number is in the answer: $$$(2^{k + 1} - 2)n - 2^k + 1$$$. Also $$$x$$$ and $$$k$$$ are positive integers. If you can come up with a proof, I would like to hear it.
There is another solution with different approach.
Idea: Leadd
for _ in range(int(input())):
n=z=int(input())
s,v,x = [2],0,1
while(n):
v+=x*((n&1)-(~n&1))
s.append(v if v>0 else 4*x+v)
x<<=1
n>>=1
c,m,y=1,2,1
for i in s:
if (m*c-i)%(m-1)==0 and m-2:print((m*c-i)//(m-1),end=" ");y=0
c+=(z-i)//m+1
m<<=1
print(-1 if y else "")
I will update here after he explain it to me but as far as I know it is something like that: There will be approximately $$$logn$$$ tours around the cycle. In one cycle only 1 number can match with its index. In the first cycle numbers increase by 2, in the second by 4 and so on. But indices always increase by 1. If we know the first number chosen in the cycle we can find if there is a matching number. There is a bitwise trick to find that first number in the cycle but as I said I will update this part after his explanation.
There is a hard version of that problem which is I'm completely unsure if it has a solution or not. Only difference is instead of skipping 1 child, skip k child. For example $$$N = 7$$$, $$$K = 2$$$. $$$P = {3, 6, 2, 7, 5, 1, 4}$$$ the answer is 5.
Thanks for reading my very first blog, don't forget to comment and share your ideas.
| Name |
|---|


