Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long ll;
- typedef pair<ll,ll> pll;
- #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL))
- #define fi first
- #define se second
- #define pb push_back
- ll const MOD=1000000007;
- #define eb emplace_back
- const int N=10000005;
- void call(ll n)
- {
- if(n<=1)
- {
- cout<<n;
- return ;
- }
- call(n/2);
- cout<<n%2;
- return ;
- }
- int main()
- {
- ll n;
- cin>>n;
- call(n);
- }
- ''''''''''''''''''''''''''''''''
- #include<bits/stdc++.h>
- using namespace std;
- using ll = long long;
- #define pb push_back
- #define ff first
- #define ss second
- #define pb push_back
- #define eb emplace_back
- typedef pair<ll,ll>pll;
- typedef pair<ll,pair<ll,ll>>plll;
- const ll mod=1e9+7;
- const ll Max=2e5+7;
- pll ara[Max+1];
- #define fastread() (ios_base:: sync_with_stdio(false),cin.tie(NULL));
- bool f;
- ll tar;
- void call(ll n)
- {
- if(n==tar)
- {
- f=true;
- return;
- }
- if(n>tar)return;;
- call(n+3);
- call(n+7);
- }
- int main()
- {
- fastread();
- ll t;
- cin>>t;
- ll ara[102];
- for(ll i=1;i<=100;i++)
- {
- f=false;
- tar=i;
- call(0);
- if(f)ara[i]=1;
- else ara[i]=0;
- }
- while(t--)
- {
- ll a;
- cin>>a;
- if(ara[a])cout<<"YES"<<endl;
- else cout<<"NO"<<endl;
- }
- }
- pb link :https://codeforces.com/contest/903/problem/A
Add Comment
Please, Sign In to add comment