vovuh's blog

By vovuh, history, 2 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?
»
2 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

»
2 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.

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

For problem E: is there some binary search solution?

»
2 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.

»
2 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.

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

    Failing testcase: Ticket 6533

    • »
      »
      »
      2 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.

»
2 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
»
2 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).

»
23 months 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?

»
23 months 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; }

  • »
    »
    22 months 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.

»
19 months 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

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

    Amazing solution! Easy to understand and prove!

»
15 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.

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

My solution for F using segment tree 214543084

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

For problem D, I tried to simulate the problem. It's giving WA on 1611th TC. I tried to stress test my solution to find a test case where my code is failing. I couldn't find any. Can anyone tell what is wrong with my logic or where my code is failing? Thanks! Code: link

»
3 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