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

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

Warm greetings,

Newton School cordially invites you to be a part of our monthly coding contest. The challenge will go live on 24th June 2022 at 9 PM IST.

Registration Link: Newton's Coding Challenge

You will be given 6 problems and 150 minutes to solve them. The contest will be rated for all!

The problems were written and tested by dnshgyl21, _deactivated_, Sawarnik, Xzirium, and _Enigma__.

We would also like to thank gkapatia for co-ordinating the contest.

Highlights of contest:

  1. The Prize Money for the top 5 performers are as follows:
    • First Prize: ₹10,000
    • Second Prize: ₹5,000
    • Third Prize: ₹2,500
    • Fourth Prize: ₹1,500
    • Fifth Prize: ₹1,000
  2. ₹100 Amazon gift vouchers to the top 50 participants.
  3. ₹100 Amazon gift vouchers to 50 randomly selected participants ranked between 51-500.

Note: Top 5 participants from other countries can opt to receive the prize money through Paypal. All the other gift vouchers will be sent in INR.

We hope you like the contest! See you all at the leaderboard! :)

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

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

When will the editorial of previous contest (May Challenge) be released?

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

can't create account

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

Sorry for stupid question but why do I have to give my phone number to register?

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

There is some issue with 1st test case of problem 1 (Possibly x and n are on different lines). Please check.

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

what's the equivalent cf rating for D ?!!...did A,B,C in 15 minutes and then got nothing for D till last (◕‸◕ )(◕‸◕ )

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

Are there system test in the contest.. My solution to A passed before but now it shows incorrect submission

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

Problem A and B were simple brute force

Problem C was a bit interesting.

Problem C

I didn't like problem D much, it was very standard.

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

why the name is newton? ..it seems to be mechanics challenge*

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

Solution for E —

For every person, we know that when he enters, he will enter in a room of exactly $$$x$$$ people and there will be exactly $$$y$$$ such rooms. These values can be easily calculated for each person using a set. Now iterate from back to front. We will calculate the expected number of people which will enter after this person enters. This can be maintained with dp and some probability calculations.

// a[i] = {number of people in the room where i goes, number of such rooms when i enters}
vector<Mint> ans(n);
vector<Mint> dp(m+10);
for(int i = n-1; i >= 0; i--){
	ans[i] = 1 + dp[a[i].first+1];
	Mint prob = Mint(1) / a[i].second;
	(dp[a[i].first] *= (1-prob)) += prob*ans[i];
}
for(int i = 0; i < n; i++){
	cout << ans[i] + a[i].first << '\n';
}

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

Please open questions and allow submitting code...