Search This Blog

Thursday, 18 August 2016

SPOJ- Will It Ever Stop (WILLITST) Problem Solution

SPOJ- Will It Ever Stop (WILLITST) Problem O(1) Solution

Solution:-

#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long int num;
    cin>>num;

    if(num<=1 || !(num&num-1))
        cout<<"TAK";
    else
        cout<<"NIE";

    return 0;

}


No comments:

Post a Comment