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

Автор ikrpprppp, 2 года назад, По-английски

Attention! Attention! Attention! Don't miss this opportunity!

Codeforces Round 961 (Div. 2) will be held on Jul/23/2024 17:35 (Moscow time)!

Problems for this round were prepared by a team of Neapolis University Pafos (yes, you've seen its logo in Educational Round announcements) students: Vitaly239239, goncharovmike, ikrpprppp.

You will be given 5 problems some of which will be divided into two subtasks and 2 hours to solve them.

Important disclaimer! Some problems of this round were also used in CPFED x JetBrains Training Camp 2024. NUP Contest in Kazakhstan this June. If you've participated in this camp or seen the problems from there, please do not participate in this round.

We would like to thank:

Not-so-important not-so-disclaimer. If you're interested in getting a Bachelor's degree in computer science in the indefinite future, you might want to take a look at Computer Science and Artificial Intelligence program in our university administered by JetBrains.

UPD. Scoring distribution: $$$500 + (1000+500) + 1750 + 2250 + (2500 + 1500)$$$

UPD2. Congratulations to the winners:

Div 2:

  1. rainboy

  2. GidrAcH

  3. toma_ariciu

  4. biximo

  5. zhengjc

Div 1 + Div 2:

  1. tourist

  2. Ormlis

  3. potato167

  4. risujiroh

  5. kotatsugame

UPD3. Editorial.

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

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

Hope I get positive delta ;(

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

As a tester, I wish good luck to participants!

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

As a tester, I will be missing the chance to participate in this amazing contest(( I hope everyone enjoys the problem set.

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

As a tester again, I tested today.

»
2 года назад, скрыть # |
 
Проголосовать: нравится -7 Проголосовать: не нравится

As a tester , The problems are worth solving !

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

As a tester, I wish good luck to every participant!

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

hopefully I'll Solve First two problems

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

As a tester, I hope you perform well this round. Good luck!

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

.

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

As a tester, contest is amazing

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

What is the point of using existing problems?

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

As a participant, i shall wake up on time

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

As a tester, the problems were really nice 👍

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

cat

»
2 года назад, скрыть # |
 
Проголосовать: нравится +72 Проголосовать: не нравится
Poor kitty got photobombed...
»
2 года назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

As a tester

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

As a tester, this is my first contest as a tester, I wish luck for participants!

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

As a participant, please give me positive delta!

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

score distribution?

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

As a participant ikrpprppp 's hair is majestic!

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

As a tester, I feel problems are interesting and worth solving. I wish good luck to all the participants.

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

As not a tester, I hope I get +3 delta

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

as not a tester hoping to get color change today

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

Maybe I'll take a step back to take a longer leap in div 3.

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

As a tester again, I tested few days ago, hope you find this round interesting:)

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

It's interesting to see a cat studying for a CS degree.

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

Какая разбалловка?

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

pic goes hard

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

Scoring distribution when??

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

As a normal user, i wish i can be CM

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

As an *out of competition participant, I want to AK a Div. 2 round for the first time.

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

scoring distribution when?

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

cute cat

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

What are the score distributions?

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

As a tester, I invited to test after the end of previous round.

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

Score distribution??

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

Is cat an official problem setter?

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

Interesting scoring distributuion

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

Indeed it is 5 problems.=)

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

Please give some easy and good questions :)

For Me

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

Doubt solved :) Thanks for the help

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

excited!!

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

Is he a tester?

Screenshot-23-7-2024-19472-codeforces-com

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

Hoping to become Pupil this round. I feel like today is the day.

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

Catforces incoming

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

So will this contest be rated?

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

Subtasks for Div.2 B? Let's see...

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
`Hope to Get `Purple Color` Back Today!!!`
»
2 года назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

I am sorry but the statement of problem D is so badly written.

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

Rare occurrence when I lost any remaining will to solve problems in a contest

See you again never

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

bad B2!

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

wth is B2

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

Problem D is just a copycat of this problem: https://acmp.ru/index.asp?main=task&id_task=884

Simply copy pasted my old code and got AC in 10 mins, dislike for testers.

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

In C if $$$a_i$$$ is turned into $$$\text{log}$$$ $$$a_i$$$, it's the same problem as 1883E - Look Back.

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

Please don't FST, please don't FST

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

why even make problem like C?

slowing down use of double for TL really make problem little bit fancy?

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

MathForces

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

These are some beautiful problems <3 I especially loved D and E

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    Can you please explain D ? ( since there isn't editorial yet. )

    What I tried...

    1. Last letter must be taken.

    2. If there is a letter, that repeats 'k' times consecutively, that letter also MUST BE TAKEN.

    3. Then on the remaining letters, I applied binary search. ( if we can do string split with k letters, then we can surely do with k+1 letters )

    But doing this binary search and bitmasking got me TLE on 8th pretest.

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

Come back to expert soon.

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

Is D somehow using bitsets over dp? Did not get any idea!

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

    Brute force all bitmasks of letters, if I had 1 more minute I would've AC.

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      Can you please explain

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

        I have yet to verify the veracity of my solution. Let's say you select some subset of letters to be the cases, let's call them "allowed" letters. Now to verify if that selection is valid, we can iterate over the string and if the current character is "allowed", we can just continue, but if it's not "allowed", it's distance to the next allowed letter must be less than $$$k$$$. The time complexity of this is $$$O(2^{c} \cdot n)$$$. This is too slow, so we have to optimize this by precalculation. We can precalculate for each letter in each mask the maximum distance to the next "allowed" letter.

        • »
          »
          »
          »
          »
          2 года назад, скрыть # ^ |
           
          Проголосовать: нравится -8 Проголосовать: не нравится

          My idea is that each character has a set of masks, each mask represnting some set of characters after the character in some index by distance of k. Now when we brute force some mask we have to make sure that all characters in the mask don't have any mask that doesn't have common bits with the mask. To make sure of that we make dp sos for each character and then we just have to make sure that no sumbask of the complement of the mask is there in this char sorry im just explaining in a bad way

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

        let d[i] = 2^(s[i] — 'A').(index from 1 to n)

        For each subarray whose length is k in d,

        let v = sum or of all elements in that subarray.

        We will have V = {v(1), v(2),..,v(n-k+1)}. (all sum or of each subarray)

        We will try all bitmask of letters. The value mask is satisfied if

        • min(mask & v(1), mask & v(2),.., mask & v(n — k + 1)) > 0

        • mask & d[n] > 0

        So we can use dp sos to find the answer in O(2^n.n)

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      I have implemented same... but I guess that will give TLE. You can also remove one letter from this bitmask, ( last letter, which must be taken ) . May be the way I implemented could be slow.

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

LOL

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

Nah, man... I don't know how to feel about it. I solved B2 still 6000 in the standing XD.

and C is ####

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

I think B2 has a binary search solution (just turn B1's brute force into binary search)

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

only solved 2 and very slow, there goes my rating. Sad

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

IS B1 is of Dynamic programming and if yes how 9k people manage to solve dp question ......leaving garden of green back to concrete layer of grey

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

worst contest last time

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

My idea for problem D came from here: 1767E - Algebra Flash. Fortunately, I remembered it just in time

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

found out the bug for c was that i put < instead of <= when there were 5 seconds left of the contest

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

If the contest had 5 more minutes, I might have solved problem D. What a pity!

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

Similar Approach for B2 anyone?

update : Got AC. I was missing an edge case when n = 1. 272176756

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

B2 with 500 pts is just not worthy doing... To many cases make it not beautiful.(in my algo) And C is mostly a Elementary mathematics prob.

»
2 года назад, скрыть # |
 
Проголосовать: нравится -32 Проголосовать: не нравится

literally the worst, worst problems I've ever seen

please don't ever make contest again.

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

Can someone please tell difference in fmin() and min() , almost was knocked out by B2 pretest 3

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

Literally finished B2 2 mins after contest is over. Figured out that we only need to look at previous flower only after a long time :(

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

I don't like math :(

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

Has anyone tried simulated annealing in E?

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

I read A wrong... Sat there for a while trying to understand it before moving to B1... Turns out I should have started with C... Which was by far much easier to understand. Unfortunately. I sat around and did nothing most of this contest.

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

why wxbqwq is banned

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

For problem D.Why my solution written by Python TLE10 ?my code

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

my humble request to problem setters , plz add the definition of diagonal in first problem, take me a long time that we have to consider diagonals in one direction only

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

B was pretty bad imho. Why did B2 have so less points? It was much harder than B1

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

how to solve D?

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

I have this idea about question D,but I'm not sure about its correctness:

        cin>>n>>c>>k>>s;
	vector<int> a(n+1),lst(19);
	vector<vector<int>> f(c+1,vector<int>(c+1,0));
	for (int i=0;i<n;i++) a[i+1]=s[i]-'A'+1;
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=c;j++)
			if (lst[j])
				f[a[i]][j]=max(f[a[i]][j],i-lst[j]);
		lst[a[i]]=i;
	}

The original problem has become a duplicate overwrite problem based on the "ok" array in the code, which we can solve with Dancing Links.

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

Shouldn't B2 have more points than B1?? 500 for B2 and 1000 for B1. It might be very less incentive for people who invested their time in coming up with general solution for B2 than just doing easy way in B1

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

anyone, how to solve b1 ?

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    You could use a sliding window. Suppose when the right bound is $$$i$$$ we can choose any left bound within range $$$[j,i]$$$. Then we only need to ensure that

    1. sum of $$$a_j,a_{j+1},\cdots,a_i$$$ is not greater than $$$m$$$;
    2. $$$|a_j-a_i|\leqslant1$$$.

    Also we should maximize the number, therefore just update $$$j$$$ for each $$$i$$$ and choose $$$j$$$ as left bound.

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

After thinking more carefully, I was dumb to resubmit B1 as I thought it was wrong. My rank was downed like 700 after doing that.

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

anyone approach for B2?

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

    You need to check lone flower types and two flower types with petals of form $$$(a, a+1)$$$. Let $$$x = a$$$, $$$y = a + 1$$$ and $$$c_1 = count(x)$$$, $$$c_2 = count(y)$$$.

    Then you need max value of $$$ax + by$$$ such that $$$ax + by \leq m, x \leq c_1, y \leq c_2$$$. With some math, you can do this in $$$O(1)$$$.

    If $$$ac_1 + bc_2 \leq m$$$ then answer is simply $$$ac_1 + bc_2$$$.

    Otherwise, we must subtract as many $$$x$$$ as we can from $$$m$$$. Then in remaining $$$m$$$, subtract as many $$$y$$$ as we can. Now we see if we can convert from $$$x$$$ to $$$y$$$ to get closer to the answer. Since $$$y = x + 1$$$, we need to figure out how much $$$1$$$'s we can add to reach the remaining $$$m$$$.

    Code
»
2 года назад, скрыть # |
 
Проголосовать: нравится -24 Проголосовать: не нравится

I think the problems are nice!

»
2 года назад, скрыть # |
 
Проголосовать: нравится -45 Проголосовать: не нравится

please unrate this round

»
2 года назад, скрыть # |
 
Проголосовать: нравится -38 Проголосовать: не нравится

please unrate this round

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

Damn. I tried passing the problem C with simple long double arithmetic after going to log(a_i), and it failed (for numerical precision, I guess) on some test. A tiny modification to use log2 log2 a_i right away -- and the solution passes. Oh well :)

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

thank you for giving me such a special experience of eating s**t.

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

Thanks to this hack, 272142115 , dozens of cheater failed system test! Even caught an expert cheater NavneetKumar123 =)

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

speedran A B1 and spent the whole contest trying to fix my implementation for B2 just to get 150 points :(

I think it could have had a higher score, considering that it's more difficult than A and B

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

Strange score distribution... B1 shoule be 500 and B2 deserves 1000.

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

My Submission for C (In PyPy) : https://codeforces.me/contest/1995/submission/272154355 It seems to be working fine on first 5 tests but seems to be giving RUN_TIME error on 6th test case (Logic seems fine to me since it passed first 5 test cases)

Can someone help ?

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

this was my first contest , I got one question accepted still am unrated how ?? can somebody help

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

Very humorous round.

I spend almost 1 hour to solve B2 but failed, then I came to C hoping to solve it. But I got WA on #5 because of precision. I thought that my solution is wrong so I continued work on it to find another solution but failed.

Also, I've heard that some participants discussing about the duplicated problems. So I think this is a very humorous round.

Hope that I won't participate in the round like this and this round will unrated.

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

    Yes I did not like this round either and I only solved A and B1 after submitting WA on C. But this does not justify the round to be unrated sometimes you have to take a hit. And the fact that others realized a problem looks same as some other problem comes to their practice which is also a pivotal factor when it comes to performing well in contests.

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

No Bangladeshi given contest today :(

Spoiler
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Thanks for the round. I finally became blue. C was kinda cool

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

Can anyone have a look at this solution for B. Fails test case — 3  

Spoiler
  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    is this one b1 or b2? I can try fixing it if u want

    • »
      »
      »
      2 года назад, скрыть # ^ |
       
      Проголосовать: нравится 0 Проголосовать: не нравится

      it is for B1 thanks for checking out!

      • »
        »
        »
        »
        2 года назад, скрыть # ^ |
         
        Проголосовать: нравится 0 Проголосовать: не нравится

        ok, i will do it in 10 minutes when I return home. Hope it's ok for u

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

          I got it bro, thanks though!

          Spoiler
»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

B2 is a piece of shit!C<<B2

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

My approach for problem C.

Spoiler
  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I had the same approach as well :)

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    I had same solution. I was surprised it passed, because if $$$\frac{\ln a_i}{\ln a_{i+1}} = 2^x$$$ and it gets calculated slightly too large, then it might be rounded up.

    Not sure if there is a hack that can break this solution.

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

      I was curious about this and tried to bruteforce all the combinations of $$$a, b$$$ ($$$1 \le a, b \le 10^6$$$) where $$$\displaystyle \frac{\ln a}{\ln b}$$$ is an integer and ceil(log(a) / log(b)) produces a wrong result. Actually there are some bad cases, but none of them are a power of 2.

      Spoiler

      (Note: I used Python to find these results. Also, in my solution, it's possible to replace $$$\ln$$$ with log with other base, like $$$\log_2$$$, and if you do so, you'll have a different set of bad cases.)

      So I was just lucky that I didn't get caught, and I actually should have subtracted an epsilon before applying the ceil function.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    can you find error in my code. I had done the same thing but changed this log2(log(a[i-1])/log(a[i])) with log2(log(a[i-1))-log2(log(a[i])).

    272229285

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

For B1, my code in contest got WA but when i resubmitted the same code after contest, it got AC.
I cannot understand why it is happening and have made a post about it.
Please clear my doubts.
Blog link
Edit -> Understood my mistake, please ignore the above comment

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

The definition of a diagonal in problem $$$\text{A}$$$ is incorrect.

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

rainboy orz

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

Can someone help me with debugging this submission: https://codeforces.me/contest/1995/submission/272209517

The failing testcase is giving correct answer locally.

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

can someone help me why iam getting WA in test 1951 ? mu sub: 272212018

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

SOSdp.....

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

Seems like B1's tests were too weak against naive quadratic approaches and simple mistakes...

Not only did I hack various $$$\mathcal{O}(n^2)$$$ solutions in 4 different ways (not counting an unordered_map hack), but also this hack was meant to be against TLs but it's just causing so many runtime errors within a short time, even a day after the contest.

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

My First approach Part 1 -: https://drive.google.com/file/d/1kdNOj823bkaOoTDYQgNWV0Q9wKVVbJMg/view?usp=sharing

Part 2 -: https://drive.google.com/file/d/1zo6zaNNjXbYbRB7AiIzzbdQLoXevoaUA/view?usp=sharing

My Second Approach https://drive.google.com/file/d/1zjdolNAiufLnNPz7NDy-Y1MPEgQ8ss_f/view?usp=sharing

And eventually i figured out the way on how to remove x — 1 petal flower cost value to buy more x petal flower

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

"Hello sir[user:MikeMirzayanov], since nobody is addressing my petition to check on my submmited codes nor answering why i got flagged as a cheater, i will then send this message and hope you can answer me. Sorry for the inconvenients but i am really mad about this situation.

Problem B1;

Since it is the same exact problem without any twists i just used my already AC solution, it is not my fault that the problemsetters did not want to place any kind of twist to the problem nor i care, if the problem was that and i did not copy it from anybody in the contest i am 100% sure that can't be counted as cheating, so please remove the skipped flag since this makes me look like a shady contestant, but i have never cheated in any CF nor any contest in my life... Thanks to the best site ever, CodeForces, From Kiavash

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

Hey, sorry but pls check my submitsion for 1995C - Squaring. I didn't share my code or post it on any websites but I received talk that say my code coincident with khoaa659 :<

btw sorry if bad english