vok8's blog

By vok8, history, 3 years ago, In English

I participated in Codeforces Round #713 (Div. 3)

I had solved the Problem 1512G — Short Task, during the contest, which I believe at least ran on 3 pretests, as many participants got WA on TC 3, during the contest.

My During-Contest AC Code ran in 1940ms, with Pretests Passed Verdict.

The intended complexity for the problem, was O(10^7 log(10^7)), as described in the editorial.

My solution's complexity was the same.

After system test, my during-contest solution got TLE'ed on TC 3, the case which was included in pretests as well. (Code)

After system test, I submitted the same solution, without changing a single word/line, it got AC'ed in 1965 ms. (Code).

I saw the leaderboard and seems like I am not the only one to have a TLE'ed solution.

I truly agree that ~100ms non-deterministic difference in run-time is possible. But, if the intended solution requires TL so close to 2 sec., then it would have been better to put the TL as 2.5s or 3s. Also, this would have helped Python/Java solutions, which TLE'ed, to pass, and also the non-deterministic difference in run-time wouldn't have affected the solutions, with "intended" complexity.

Please, look upon this suggestion MikeMirzayanov.

Thank you.

Correct me, if I have wrote something wrong or contradictory.

Full text and comments »

  • Vote: I like it
  • +24
  • Vote: I do not like it

By vok8, history, 4 years ago, In English

  • Submission-1: (AC - 856 ms)


  • Submission-2: (AC - 1824 ms)


The Code

  • The code in the above 2 submissions is wholly same/identical (Not even a single bit in the codes is differing).

  • I ain't getting what could be the reason of such a huge time difference between the running time of fully identical codes. I mean, 30-100 ms difference is fine, as that can be there, due to server load and/or some other server related stuff. But, the difference is ~1 second, which seems very weird and strange.

  • For checking the correctness of what I have experienced, you can try submitting the above code 2-3 times continuously, after some 2-3 min stretch, between each submission. I think, you will get my doubt perfectly, then!

  • Can someone please explain, what can be the reason behind this huge "running time" difference?

  • Thank you!

Full text and comments »

  • Vote: I like it
  • +21
  • Vote: I do not like it

By vok8, history, 4 years ago, In English
  • Problem: XXOR

  • Submission-1: Link (Runtime Error)

  • Submission-2: Link (Accepted)

  • The difference between both the submissions is just the two cout<<""; statements, in the two "n" range for loops.

  • The cout<<""; statements are uncommented in Submission-2 and commented in Submission-1. And guess what, these statements convert a RE Submission to an AC Submission.

  • The code in Submission-1, for a Valid Random Input, runs finely in Codeforces' Custom Test, whereas it gives RE in AtCoder's Custom Invocation. (You may try, for more clarification and to find the reason!)

  • I found it weird! I am totally clueless about why this is happening. Can anyone please justify or explain, why is this happening?

  • Thank you!


UPD: It seems like, the cout<<""; statement(s) in the "n" range for loops, avoid (stop) the optimisation(s), which -OFast + "avx2" try to make, hence, converting the RE solution into an AC solution.

Full text and comments »

  • Vote: I like it
  • +14
  • Vote: I do not like it

By vok8, history, 4 years ago, In English

Laxman and Maths

Logic (Explanation)
Problem Setter's Code

-/-/-

Raavan and Subarray

Logic (Explanation)
Problem Setter's Code

-/-/-

Bharat and Possibilities

Logic (Explanation)
Problem Setter's Code

-/-/-

Hanuman and Tree

Logic (Explanation)
Problem Setter's Code

-/-/-

Lord Ram and XorOrXorOr Power

  • Problem Setter: vok8
Logic (Explanation)
Problem Setter's Code

-/-/-

Luv Kush and FX Sequence

  • Problem Setter: vok8
Logic (Explanation)
Problem Setter's Code

-/-/-

Sita Mata and Time Machine

  • Problem Setter: vok8
Logic (Explanation)
Problem Setter's Code

Full text and comments »

  • Vote: I like it
  • +25
  • Vote: I do not like it

By vok8, history, 4 years ago, In English

Hello Coders,

Greetings from algo_UNLOCK, the CodeChef Campus Chapter of Pandit Deendayal Petroleum University!

We are glad to invite you to our 2nd Programming (DSA) Contest, Programming Contest #1 (Chapter 'Ramayan'). You will be given 7 problems, and 3 hrs. to solve them! The contest will start on Monday, May 18, 2020 at 21:00 IST.

  • Rank-list Type: ACM (10 minutes penalty, for each wrong submission)

  • The Contest will be unrated.

The Rank-list will freeze one hour before the contest ends!

  • Problem Setters: vok8, Pallove

  • Prizes: "250 Laddus" each, will be awarded to the Top 3 users, in the Rank-list. (Only, if the total participants in the contest >80)

We thank the CodeChef Team for their help in setting up the contest!

We hope, you all will enjoy solving the problems!

We will post the editorials for all the problems, after the contest!

Happy Coding!

Stay Safe!

Good Luck!

UPD-1: Congratulations to the Contest Winners!

  1. uwi
  2. Rahul
  3. nishant403

UPD-2: Everyone can find the Editorial for all the Problems, here.

UPD-3: Please share your valuable Feedback, about the Contest. (Link)

UPD-4: "250 Laddus" (each) have been credited to the CodeChef Account of the Winners (Top-3).

Full text and comments »

  • Vote: I like it
  • +44
  • Vote: I do not like it