Search This Blog

Showing posts with label Will It Ever Stop O(1) Solution. Show all posts
Showing posts with label Will It Ever Stop O(1) Solution. Show all posts

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;

}