Codeforces Round #726 (Div. 2)

Codeforces Round #726 (Div. 2)
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define all(x)     x.begin(),x.end()
#define pb(x)      push_back(x)
#define ppc        __builtin_popcount
#define ppcll      __builtin_popcountll
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2>&p){in>>p.first>>p.second;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream&out,pair<T1,T2>&p){out<<p.first<<" "<<p.second;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
signed main()
{
    ios::sync_with_stdio(false);
    int t;
    cin>>t;
    string a="Alice",b="Bob";
    while(t--){
        int n;
        cin>>n;
        if(n==1)cout<<b<<"\n";
        else if(ppcll(n)==1){
            int cnt=0;
            while(n)cnt++,n/=2;
            if(cnt%2==0) cout<<b<<"\n";
            else cout<<a<<"\n";
        }
        else if(n&1)cout<<b<<"\n";
        else cout<<a<<"\n";
    }
}
D

 

Codeforces Round #726 (Div. 2)
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define all(x)     x.begin(),x.end()
#define pb(x)      push_back(x)
#define ppc        __builtin_popcount
#define ppcll      __builtin_popcountll
template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2>&p){in>>p.first>>p.second;return in;}
template<typename T1,typename T2>ostream& operator<<(ostream&out,pair<T1,T2>&p){out<<p.first<<" "<<p.second;return out;}
template<typename T,typename T1>T amax(T &a,T1 b){if(b>a)a=b;return a;}
template<typename T,typename T1>T amin(T &a,T1 b){if(b<a)a=b;return a;}
signed main()
{
    ios::sync_with_stdio(false);
    int n,k;
    string s;cin>>n>>k>>s;
    int best=0;
    for(int i=0;i<n;i++){
        int a=s[i];
        int b=s[i%(best+1)];
        if(a>b)break;
        if(a<b)best=i;
    }
    int i=0;
    while(k--) cout<<s[i++%(best+1)];
}
E

 

Codeforces Round #726 (Div. 2)

上一篇:Layui layuidate 最大值不能超过今天


下一篇:Jmeter中将变量组合后生成另一个变量