vovuh's blog

By vovuh, history, 3 years ago, translation, In English

1674A - Number Transformation

Idea: BledDest

Tutorial
Solution (BledDest)

1674B - Dictionary

Idea: BledDest

Tutorial
Solution (BledDest)

1674C - Infinite Replacement

Idea: BledDest

Tutorial
Solution (awoo)

1674D - A-B-C Sort

Idea: BledDest

Tutorial
Solution (adedalic)

1674E - Breaking the Wall

Idea: BledDest

Tutorial
Solution (fcspartakm)

1674F - Desktop Rearrangement

Idea: vovuh

Tutorial
Solution (vovuh)

1674G - Remove Directed Edges

Idea: BledDest

Tutorial
Solution (awoo)
  • Vote: I like it
  • +85
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Thank you codeforces for this Round, Good to see many Div-3, and the standard of questions was perfect for the level of div-3

»
3 years ago, # |
Rev. 3   Vote: I like it -7 Vote: I do not like it

I think problem F will be done with Fenwick tree,too.

»
3 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

For problem E: is there some binary search solution?

»
3 years ago, # |
  Vote: I like it -10 Vote: I do not like it

It's interesting how none of the first three problems required loop.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Can anyone tell why I'm getting runtime error: Exit code is 2147483647 for submission: 155822852 I tried a lot but not understanding what's wrong.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Failing testcase: Ticket 6533

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Thanks, but why does it not run as required?
      There something wrong at line 100 tree[node1].push_back(node2);. But I'm not able to understand why this is happening.

»
3 years ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

After the contest, I successfully hacked most people with this example

3
3 3453 5
»
3 years ago, # |
  Vote: I like it +3 Vote: I do not like it

If you prefer command line, checkout CF Doctor for more flexibility and faster feedback.

If you are/were getting a WA/RE verdict on problems from this contest, you can get the smallest possible counter example for your submission on cfstress.com. To do that, click on the relevant problem's link below, add your submission ID, and edit the table (or edit compressed parameters) to increase/decrease the constraints.

If you are not able to find a counter example even after changing the parameters, reply to this thread (only till the next 7 days), with links to your submission and ticket(s).

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone overcame testcase 32 of Problem E after getting WA? Or, any equivalent short length testcase please?

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

can i any one tell what is wrong in my code for question infinite replacement void solved(){ string s; cin>>s; string t; cin>>t; bool infinite=false; if(t=="a") { cout<<"1\n"; return;} for(int i=0;i<t.size();i++){ if(t[i]=='a') { infinite=true; break; } } if(infinite){ cout<<"-1\n";

} else{ int ans = 1; for(int i=1;i<=s.size();i++){ ans = (ans*2)%Mod; if(ans<0) ans = ans+Mod; } cout<<ans<<"\n"; }

} int main(){ int t; cin>>t; while(t--){ solved(); } return 0; }

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    You are taking mod, thats why its giving WA for the cases where answer is >= Mod. The problem does not ask to take mod.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I know I'm quite late, but I don't see my solution to G.There is maybe a simpler (not sure if its simpler) solution to G. 1. Remove all edges u,v such that (inDegree[u]==1 || outDegree[v]==1). 2. Now the answer is the longest possible path in this new graph. Proof is also quite simple. Here is my 171163896

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Amazing solution! Easy to understand and prove!

»
23 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Question F so simple... why rated 1800? It suits problem B or even A div2.

»
17 months ago, # |
  Vote: I like it -14 Vote: I do not like it

My solution for F using segment tree 214543084

»
11 months ago, # |
  Vote: I like it 0 Vote: I do not like it

My approach to problem F: We can convert the given matrix to a 1-d array while traversing the matrix for each column from 1st row to the last nth row and placing 1 for a '*' and 0 for '.'

Let the current number of 1's in our array be x. So now we have to find the number of empty positions in our 1-d array in the range [0 , x — 1] , as we have to place 1's at that positions from the rest of the array

This can be easily done either with a rangeSum segment tree link or an ordered set link

  • »
    »
    5 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    son you are a genius to convert into 1d array. good work

»
2 months ago, # |
  Vote: I like it 0 Vote: I do not like it

O(q(n+m)) solution easily passes in problem F, making it easier than a 1400 in my opinion.

My submission: 285215206

»
5 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Thanks for this round , it's a great one

excited to see many div-3