Skip to content

Commit f6a0fb1

Browse files
Strange Counter Problem
1 parent 03bad46 commit f6a0fb1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

strange_counter.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# include <bits/stdc++.h>
2+
3+
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
4+
#define f(i,a,b) for(i=a;i<b;i++)
5+
#define fr(i,a,b) for(i=a;i>=b;i--)
6+
#define endl '\n'
7+
#define ll long long int
8+
#define ff first
9+
#define ss second
10+
#define pb push_back
11+
#define mp make_pair
12+
#define mod 1000000007
13+
14+
using namespace std;
15+
16+
int main()
17+
{
18+
ll t, pts = 3;
19+
cin>>t;
20+
while(t > pts)
21+
{
22+
t -= pts;
23+
pts *= 2;
24+
}
25+
cout<<pts - t + 1;
26+
27+
}

0 commit comments

Comments
 (0)