Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

Блог пользователя skhan_org

Автор skhan_org, история, 3 года назад, По-английски

We invite you to participate in CodeChef’s Starters119, this Wednesday, 31st January, rated for till 6-Stars (ie. for users with rating < 2500). This contest is organised by Coding Club, IIT Ropar, as part of Advitiya 2024.

Time: 8:00 PM — 10:00 PM IST

Joining us on the problem setting panel are:

Written editorials will be available for all on discuss.codechef.com. Pro users can find the editorials directly on the problem pages after the contest. The video editorials of the problems will be available only to Pro users.

Also, if you have some original and engaging problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Hope to see you participating.

Good Luck!

  • Проголосовать: нравится
  • +48
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится
»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

I can get the exact failed test case when the verdict is WA but not when the verdict is runtime error

»
3 года назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится

A little tight time limit in my opinion for Guess Who Delivers. int passes the time limit but long long exceeds it.

Code for long long

Code for int

»
3 года назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

Unalike Gcd & Lcm has weak test cases Like below one could be a counter case. (when a bigger prime is X and P too)

counter case:
1
998244353 1
998244353
correct output:
1
incorrect output (from the above submission):
2

Hackable Submission

This line is making it hackable.

155.    if (x > 1) p.pb(x);

Which should have been

155.    if (x > 1) p.pb(1);

Which I corrected in later submission

»
3 года назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

How to solve Xorred

»
3 года назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

Really enjoyed the problems especially Guess Who Delivers, Submission. Will try upsolving Xorred.

»
3 года назад, скрыть # |
 
Проголосовать: нравится +4 Проголосовать: не нравится

idk if this solution for d1B is intended but:

First if $$$P\gt 30$$$ the answer is 1.

So now with memorization of the queries we only need to handle $$$Q\le 30$$$ and $$$P\le 30$$$.

enumerate $$$\gcd(x,y)=d$$$ through all divisors of $$$x$$$. then $$$y=\dfrac{d^{P+1}}{x}$$$. we just need to check if $$$\gcd(y,x)=d$$$. or $$$\gcd(\dfrac{x}{d},\dfrac{d^P}{x})=1$$$. then, enumerate through all prime divisors $$$v$$$ of $$$\dfrac{x}{d}$$$. use quick power to check if $$$d^P\equiv 0 \pmod x$$$ and all $$$d^P\bmod (x*v)\neq 0$$$.

also before enumerating through divisors, we need to just pick out all the divisors that are multiples of all the prime divisors of $$$X$$$. total complexities is $$$O(T\min(Q,30)d(X)\log X\log X)$$$ or sth?

im stuck in this problem for 1h cuz i didn't find out that $$$P$$$ has to be $$$\le 30$$$ at first...