From 1815f2b3e0bfb010464c63f7cc11234525132c12 Mon Sep 17 00:00:00 2001 From: Developer <114725350+SusanStorm@users.noreply.github.com> Date: Tue, 4 Oct 2022 16:12:19 +0530 Subject: [PATCH] Newbie_Solution --- .../1527 A. And Then There Were K | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Have a Fun with 0 and 1 :)/1527 A. And Then There Were K diff --git a/Have a Fun with 0 and 1 :)/1527 A. And Then There Were K b/Have a Fun with 0 and 1 :)/1527 A. And Then There Were K new file mode 100644 index 0000000..3531950 --- /dev/null +++ b/Have a Fun with 0 and 1 :)/1527 A. And Then There Were K @@ -0,0 +1,33 @@ +#include +using namespace std; +typedef long long int ll; +const int N=1e9+7; +bool cmp(pair&a,pair&b){ + return a.second>=1; + } + return ans; + } +int main() { + ios::sync_with_stdio(false), cin.tie(0); + ll t;cin>>t; + while(t--){ + ll n,x,y,z,ans,cnt=0; + cin>>n; + + while(n>0){ + n=n/2;cnt++; + } + cnt--; + ans=power(2,cnt); + cout<