ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1705. Gangster Hares

TLE test 3!!!!
Posted by vk 4 Apr 2009 14:48
Re: TLE test 3!!!!
Posted by yaho0o0 4 Apr 2009 16:01
and i have the same mistake
Re: TLE test 3!!!!
Posted by yaho0o0 4 Apr 2009 16:01
#include <iostream>
using namespace std;
int main()
{
    int i,a,t,j,o[30004];
    cin>>t;
    for(i=1;i<=t;i++)
    {
        cin>>a;
        for(j=1;j<=20;j++)
        {
            if(((a-(a%j))/j)<=(a%j))
            {
                o[i]=j;
                break;
            }
        }
    }
    for(i=1;i<=t;i++)
    {
        cout<<o[i]<<endl;
    }
    return 0;
}
Re: TLE test 3!!!!
Posted by Warmup for regional 30 Apr 2009 16:55
I tried to solve the minimum K where (double)(n/k)-(double)(n/(k+1)) < 1.0 and then I iterate on this min_k till find the answer which [n/k]==[n/(k+1)], but I got TLE on test 3. Is there any special test case which cause me to get TLE?
Re: TLE test 3!!!!
Posted by Fyodor Menshikov 2 May 2009 16:38
Warmup for regional wrote 30 April 2009 16:55
Is there any special test case which cause me to get TLE?

There is no special test case in this problem, just maximal test.

t=30000.
n are random near 10^18 for example in the range [10^18-10^17, 10^18]