Vasillia's blog

By Vasillia, history, 18 months ago, In English

I am getting wa on test1 in my submission of this problem https://codeforces.me/problemset/problem/1990/E1.

This is my submission: https://codeforces.me/contest/1990/submission/318085732.

When i run my code manualy on my computer and answer the queries manualy I get correct solution for test1. But when i submit I get wa. Can someone tell me where is the problem in my code? It is possible that my algorithm is wrong for the overall solution of a problem so please dont tell me what solution of problem is.

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

| Write comment?
»
18 months ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

The issue is this

cout << "! " << sol(G, n, 0) << endl;

Do this instead

int ans = sol(G, n, 0);
cout << "! " << ans << endl;