F

F题尽量让相同字符远离,尽量减少“000000”和“111111”这种连续的字符串,代码如下😘

#include<bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    for(int i=0;i<t;i++){
    long long n,m;
    cin>>n>>m;
    if(n>m){
        while(m>0){
            long long num=n/(m+1);
            while(num--)
                cout<<0; 
            cout<<1;
            n-=n/(m+1);
            m--;
        }
        while(n--)
            cout<<0;
    }else{
        while(n>0){
            long long num=m/(n+1);
            while(num--)
                cout<<1;
            cout<<0;
            m-=m/(n+1);
            n--;
        }while(m--)
            cout<<1;
    }
    cout<<endl;
}
}

G

直接输出277777788888899和27777789999999999,别问我为什么,问就是我也不知道😎

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long a=277777788888899;
    long long b=27777789999999999;
    cout<<a<<" "<<b;
    return 0;
}