sherewillpower's blog

By sherewillpower, history, 4 years ago, In English

Hi, I've been trying to solve this problem(Building Blocks on codechef) for some time now but always end up with a WA.

I have matched my output for all inputs(n = 0 to 10^5) with that from an AC code and found no differences.

When I submit my code it fetches me a WA while the other code gives an AC veridct. :(

My submission: https://www.codechef.com/viewsolution/15623378

AC code with which i matched my output : https://www.codechef.com/viewsolution/15618920

I can't seem to understand whats wrong. Is this an issue of the judge? Any help would be appreciated.

Thanks!

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

By sherewillpower, history, 4 years ago, In English

I am trying to learn Dinic's algorithm to find max flow for a given graph. However my implementation for the same is timing out for the 11th pretest for the question FASTFLOW on SPOJ whatever I do. It's been a day and I haven't been able to find the fault. Please can anyone help me optimize my code further?

Link to question : http://www.spoj.com/problems/FASTFLOW/

My code: http://ideone.com/7FFYRy

Any help would be appreciated, Thank you.

Read more »

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