I used the same logic, i was just passing pointers to the function, i used Fast I/O, so that wasn’t even the problem, my code first TLEd in only 2 and then submitted it again and got TLE in 4. I tried to remove one bfs for the finding the root by using something similar to disjoint set, but I already wasted a lot of time so I messed it up.
I used the same logic and got TLEs in 4 out of 9 subtests of question 1, subtask 2! Is there any way to access my code now? (I have the credentials but codechef says the account has been deleted)
I know, you’re not alone. I initially wasn’t planning on bringing this up and making the first post on this thread because I thought it was just me but now that there are actually some other folks who are facing the same issue, I’m actually intrigued now.
How could it be possible that the code takes fluctuating time on a judge ?
It depends on which computer of server you code executes and on how many processes are being run on that computer of server. But the difference is negligible for an optimised code.
Same here
TLE on 4 out of 9 subtasks 
What do you people mean by TLE ?. When you submitted in the contest, the status showed TLE or are you running tests on your computers and taking time ?
When I submitted in the contest, the status was TLE
You seriously did that ? 
My system got hanged just after opening the file and had to restart it
No, of course, that it in itself is common sense. I’m talking about how the test cases could have been so strict that even though there were several algorithms submitted, it would only choose to accept a certain DFS code and say, not one with a little higher constant factor. Ideally, as long as the logic is same, the code should AC because hey, we’re all doing the same stuff - declare arrays, performs calculations, etc.
@sudheerays123, that’s literally goes to show how many times I double checked the program 
Did you clear the adjacency list at the end of each test case.
The test cases gave TLE rather than RE/WA if you did not clear it.
I did not clear it on the first try, got TLE thought that the tests were pathological and did not allow recursion, started writing bfs code, then realized that I did not clear the adjacency list.
Can anyone who is in class X and above and who got 100 abv tell me since when they r into competitive programming??
I got 132 and started a month ago.
Got 132 and doing since 1.5 years 
Any idea when the results will be declared?
Uhhhhh, wait what??
If you did not clear it, you get a TLE? That’s messed up 
But no, I did clear all my adjacency lists and even reset my global variables. I wouldn’t have got an AC on all other tests cases.
My code wasn’t wrong, I checked by downloading the zip file and running all test cases. We are talking about why several of us faced TLE’s in our code despite coding the inherently same logic. We aren’t concerned with those that got WA(s).
Please send the rewritten code here. I’m willing to try to find the issue
-
INOI marks are out, they’ve been mailed to us.
According to the mail, tentative cutoff is 200 for X and above and 132 for IX and below. -
We can access our exam accounts now so @tush_chen send your code, I’m curious to see what the problem may have been.
Even I had the same problem
Here is my code : #include <bits/stdc++.h>using namespace std;#define fastio ios_base::sync_wi - Pastebin.com
Can someone pls tell me why I was getting TLE
Thanks ![]()
And here I was thinking people talking about 200 cutoffs are being funny…
the problem with your code is that during your BFS call you are initialising the distance array and visited array which results in a O(N^2) running time.