Saul_Goodman_'s blog

By Saul_Goodman_, history, 3 years ago, In English

In this problem: https://codeforces.me/contest/1608/problem/C I keep getting WA and I don't know exactly what is wrong with my code

Approach: I make 2 arrays that represent the value of A and the value of B and then sort them according to the value in ascending order. After that, I go through the array A from the end till the beginning and for each i I see if it can beat the biggest A in the second map which is B, and if this is true then this i can win the game. after I finish with array A I do the same thing with array B.

Code: https://ideone.com/txcuRy

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

| Write comment?