using namespace std;. You certainly don't need to write it twice!!
// your code goes here along with the duplicated
using declaration makes me think that you did not really proof-read your own code first. Pay attention to what you're writing! It will go a long way to finding improvements and silly mistakes.
#include <bits/stdc++.h> is not a standard header. Some kind of implementation-specific header? Or is it internal details you are not supposed to use directly? Looking it up on Google, I see it's supposed to include all the standard headers... so why are you including others directly as well, and if it's supposed to be a precompiled header it needs to go first. Again, it looks like you're just pasting things together and not understanding or reviewing what you wrote.
Don't use the C macro
NULL. C++ has a keyword
ans doesn't seem to be used anywhere, so why are you declaring it? See comments above. In general, don't define things ahead of their use, though the nature of
cin>> I see why you are not initializing
t. Generally don't declare more than one thing at a time.
std::cin >> t;
So you loop counting down
t until it reaches 0. You need
t to be a arbitrary precision int because 64 bits isn't big enough?? If you are looping 2 to the 64 times, that would indeed take a long time. That's 1.8e19, and if each iteration took one nanosecond that's still on the order of ten billion seconds, or 317 years. So I seriously question your need to make
t an extended precision integer and not a plain built-in 32-bit or 64-bit integer.
count where you are counting up. Does your program run for hundreds of years? If not, 64 bit integers is enough!
Note for performance that
% is a very slow operation.