nims11
BIOS Terminator
i am trying to solve this easy problem at codechef.comOdd | CodeChef
i have made a really short program to solve it. it gives correct answers when i test. but it exceeds the time limit in the codechef servers.
my code is
suggestions plz....
i have made a really short program to solve it. it gives correct answers when i test. but it exceeds the time limit in the codechef servers.
my code is
Code:
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
int n;
cin>>n;
while(n--)
{
int a;
cin>>a;
cout<<(int)pow(2,(float)((int)log2(a)))<<endl;
}
return 0;
}
suggestions plz....