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

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

Hello, Codeforces!

I'm very glad to invite you to participate in CodeTON Round 4 (Div. 1 + Div. 2, Rated, Prizes!), which will start on Mar/31/2023 17:35 (Moscow time).You will be given 8 problems and 2 hours to solve them. The round will be rated for everyone.

I'd like to give my sincere thanks to:

Hope everyone can enjoy the round!

UPD: The tutorial is here.

And here is the information from our title sponsor:

Hello, Codeforces!

We, the TON Foundation team, are pleased to support CodeTON Round 4.

The Open Network (TON) is a fully decentralized layer-1 blockchain designed to onboard billions of users to Web3.

Since July 2022, we have been supporting Codeforces as a title sponsor. This round is another way for us to contribute to the development of the community.

The winners of CodeTON Round 4 will receive valuable prizes.

The first 1,023 participants will receive prizes in TON cryptocurrency:

  • 1st place: 1,024 TON
  • 2–3 places: 512 TON each
  • 4–7 places: 256 TON each
  • 8–15 places: 128 TON each
  • …
  • 512–1,023 places: 2 TON each

We wish you good luck at CodeTON Round 4 and hope you enjoy the contest!

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

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

Auto comment: topic has been updated by RDDCCD (previous revision, new revision, compare).

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

As a tester, give me TON.

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

As a tester, problems are great, recommend everyone to participate!

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

May this will be my color change contest

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

Finally a div1+2 round after half month.

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

Hope I can bounce back from my horrendous performance last time.

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

Nostalgia hit me.

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

My first div1...ready to face the challenge

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

so excited !

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

As a tester, problems are educational and wonderful, hope everyone can enjoy

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

TON is about 2.10$, Thank me later :)

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

hope to be Expert

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

As a tester, give me TON.

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

Hope I will solve A anh B @@ As a participants, hope everyone have the best work!!

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

I will AK it using Genshin Impact:)

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

.

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

Where will these ton tokens be transferred? I mean we haven't filled a wallet address whole registration neither is there a link to put our wallet address on website or any other place.

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

Can anyone explain why we can read many times ".... give me a TON"?

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

As a tester, I think this contest is very worthwhile to participate in. I hope everyone who join this contest can get satisfactory results.:)

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

We need a TON of positive delta rating!

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

I hope to reach 2100, and I wish everyone all the best!!

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

Will try to cross 1500 this time. Looking forward to solve upto 4 problems.(atleast 3).

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

facing long in queue problem!!

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

Will a scoring distribution be announced?

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

I'm jiangly fan,jiangly is No.1!!!

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

I really wanna reach 1900 today. The mark has been psyching me out for so long now. I dont wanna care about my rating!!!! I wish me and you all the best!! (I just wish it a tiny bit more for myself :D)

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

Where's score distribution?

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

Where's score distribution?

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

What Happened to tourist ?

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

jiangly! best of the best

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

I'm very excited to see editorial for task H!

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

Good round! Sadly I ran out of time for D and I think I would have been able to solve with ~10 more minutes.

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

hard round.

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

Problems were great overall, but needing to use Fibonacci Heap for E in Java to not TLE was obnoxious.

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

Problem B is the same problem as one of the problem in Constructor Open Cup Contest yesterday

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

The time of which of the submissions counts to the result on codeforces? The first or last?

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

B is almost absolutely the same as a problem in Constructor Open Contest 2023 which was yesterday

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

Submited D in last second but system didnt register it, also B is harder than C or D

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

Problem E is solvable using "Kruskal Reconstruction Tree" technique. The weight of edge (u, v) is max(a[u], a[v]). After we built the tree, we climb from leaves with a[u] = 0 and check if we can climb up to the root in the reconstruction tree.

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

Any hints for D?

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

How to do E?

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

bool isPossible(long long int mid, long long int height, long long int a, long long int b) { if(((a-b)*(mid-1LL)*1LL) + a >= height) return true; else return false; } long long int calDays(long long int height, long long int a, long long int b) { if(height == 0) return 1; if(height <= a) return 1; long long int left = 1; long long int right = 1e18; while((right - left) > 1) { long long int mid = left + ((right - left)/2); if(isPossible(mid, height, a, b)) right = mid; else left = mid+1; } if(isPossible(left, height, a, b)) return left; else return right; }

In question D, I was trying to find number of days taken by snail to reach height h, given a and b using Binary search. Is something wrong in my approach as I am getting WA in TC5.

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

Can anybody Tell me why my code fail in Problem C

https://codeforces.me/contest/1810/submission/200015122

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

    Firstly,You haven't considered all possible start mex values(according to your code you have checked for 1 and 2) and even after this,all possible combinations of insertions and deletions that are possible are not considered (try looking at the editorial or look into my submission for a better understanding of it) Happy Codeing:)

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

Any ideas why this D is failing pre-tests? I spent 1 hour debugging and could not find the bug:

https://codeforces.me/contest/1810/submission/199997167

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

I got 7 WAs on D trying to use binary search before realizing it was just math...

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

is Div2D solvable with just math?

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

Determining whether a node is good (you can start from the node and reach the entire graph) is just implementation.

The solution of E is quite straightforward when you observe that if a node is not good, the nodes it can reach are also not good.

Edit: Systest accepted, but not sure if there is an test case that will TLE this

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

Nice div1+div2 contest. Solved A-E. My solution of F passed pretest but it's very likely to get TLE on system test.

A: We just to need check if there's any i where a[i]<=i.

B: We can only get odd number by operation, so if n%2==0 there's no solution. Otherwise, we can represent (n-1)/2 in binary, and add 1 to all digits (for example: 17 -> (17-1)/2=8 -> 8=1000(2) -> answer is 2 1 1 1).

C: First we can remove all numbers and add single 1, which costs n*c+d. Otherwise, assume the size of the final permutation we get is k (and k>1), and there are m missing numbers in range [1, k] in the initial array. Then we need to add m numbers and remove (n-(k-m)) numbers, the cost is c*(n-(k-m))+d*m = c*n + (c+d)*m — c*k. If we let k+=1 and m+=1 (which means, k+1 is a missing number in the initial array), the cost will increase by d, so in any optimal answer, k must be a number in the initial array. So we can iterate for every possible option of k and get the answer.

D: Implementation problem. We just need to maintain the upperbound and lowerbound of h for each type-1 query, and for type-2 query we need to check if the answer for (h_max, a, b) and (h_min, a, b) are the same. Be careful for case a>=h.

E: DSU. We sort edges (u, v) by the value of max(a[u], a[v]) and add them by this order. First mark all nodes with a[u]==0 as good. WLOG assume a[u]>=a[v]. When mergeing (u, v), if v is good and the size of component of v is not greater than a[u], we mark all nodes in the component of (u, v) good. To defeat all monsters, we need the graph to be connected and all nodes are good.

F: The answer is ceil(log_m(sum(m^a[i]))). We need to maintain the base-m representation of sum(m^a[i])) by a segment tree, and update it by binary search.

Update: Upsolved F with atcoder library: 200024728

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

Although managed to solve D and probably will get positive delta, still problem D was awful in my opinion. There was nothing interesting about it. It just required being extra careful, which is very annoying.

A was ok, B and C were nice.

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

I don't understand problem D, anyone help me:((

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

Problem D is really orz

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

As a contestant who won 4TONs, please give me TONs

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

Jiangly!!!

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

May I know why my problem A's submission is still in pretest passed stage?

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

weak pretests on E? I passed pretests in 295 ms and seemed to have failed systests :(. Hurts more since I was going to reach CM.

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

    Looks like this is on me. My solution is the same as edi's except I set visited as 0 for all nodes each time I bfs instead of setting visited as 0 only for nodes visited in the last bfs which significantly worsens complexity.

    Still sad how the pretests didn't catch this.

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

A round with a 200000000 parcel?

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

Congratulate nightcrawler0112 for submitting the 2e8-th solution 200000000 in this contest!

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

Due to a network failure, I accidentally submitted my solution to problem D twice (see 199967726 and 199967904) and got a resubmission penalty. Is there a way to get my score back?

Also, hats off to everyone who prepared this fantastic contest, and I'm excited to finally become red after 5.25 years of cp!

»
4 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Help! Why is the code for my question D passable in GNU C++17 or GNU C++14, but not in GNU C++20? I used the ceil function at first, but changed it later and still had the same problem. Here is the link to my code:https://codeforces.me/contest/1810/submission/200022673
»
4 года назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

Awesome contest (at least problems A-D)!

However I have a question regarding the problem D. This is what some test case (second test case in Example) can look like:

3
1 6 5 1
2 3 1
2 6 2

The answer is

1 -1 1

Why is the second number $$$-1$$$, and not $$$3$$$?

From the first event we can get that $$$h=6$$$. That is the only possible solution for $$$h$$$. We have $$$h$$$ and in the second event we are given $$$a$$$ and $$$b$$$. We can now calculate $$$n$$$ with formula $$$n=$$$ $$$\lceil \frac{h-b}{a-b} \rceil$$$ and that equals $$$3$$$.

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

Anyone knows why my C fails?

https://codeforces.me/contest/1810/submission/199982867

Any help is appreciated.

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

Is it suspicious if someone submits D and E with 8 mins gap and there's different style of giving brackets in all the submission (submissions of D and B don't have extra space before curly braces while E, C and A have)

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

How do we receive TON, if we ranked below 1024? Did we have to fill some form or will we automatically receive mail for the same?

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

Isnt the test case 5 of C wrong, the min cost comes out to be 22, not 20.

Dropping a duplicate 4: 2

Inserting 1,2: 2*8 = 16

Dropping 7,8: 2*2 = 4

Total = 2+16+4 = 22

while the answer is given to be 20. Can someone help me with this, if I am wrong? Thanks

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

Finally turned purple with this contest. Thanks for the Amazing round!

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

D was undoubtedly unclear problem statement. Much more clarification was needed

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

How and when do we recieve toncoin prizes

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

Can someone please help me with my submission of problem D submission Thank You

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

@RDDCCD

RDDCCD

EDITORIAL IS NOT ACCESSIBLE.

I had written one comment on yesterday's editorial. After which I had received some downvotes. Is that why I am banned from seeing an editorial page...

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

For E, how can m > 0, if n = 1?

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

Can anyone explain why my code fails for E? 201160823 . I have tried to implement the editorial.

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

Has anyone received TON coins? When will it be released?

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

Edit: I just received it, thank you!

Am I the only one who didn't receive the ton prize?

It's been over a month now.

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

I was notified the my solution for the contest match with some other solution in problem A. When this round took place I was not aware about how to address this issue so I am commenting now. Your solution 199973419 for the problem 1810A significantly coincides with solutions shreyansh_125/199969542, Mr.Roamer/199973419. Look at the solutions , I am shocked that the plag checker also checked Problem A , as it's code is so simple everyone can write it's code similar to mine. It's just a coincidence that we used same variable names (which are also common names). Pls check both solutions I did not copied any code.