武汉工程大学2020GPLT选拔赛

A-L1-1 I LOVE WIT_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
#define ll long long
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5+7;
const int mod = 1e9+7;
int n,m,k;

void sovle(){
    cout<<"I"<<endl<<endl;
    cout<<"  L"<<endl;
    cout<<"   O"<<endl;
    cout<<"    V"<<endl;
    cout<<"     E"<<endl<<endl;
    cout<<"       W"<<endl;
    cout<<"        I"<<endl;
    cout<<"         T";
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

B-L1-2 单位换算_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
#define ll long long
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5+7;
const int mod = 1e9+7;
int n,m,k;

void sovle(){
    scanf("%d",&n);
    if(n%5==0){
        cout<<1524*(n/5);
    }else{
        printf("%.1f",1.00*n*12*2.54*10);
    }
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

C-L1-3 Pok&eacute;mon_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

注意乘0.99

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
#define ll long long
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5+7;
const int mod = 1e9+7;
int n,m,k;
double x[9];

void sovle(){
    for(int i=0;i<7;i++) scanf("%lf%*c",&x[i]);
    scanf("%d %d",&n,&m);
    if(m) x[n]*=0.01;
    else x[n]*=0.99;
    printf("%.2f",x[n]);cout<<"%";
}

signed main()
{	
    //ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

D-L1-4 颠倒阴阳_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
using namespace std;
typedef pair<int, int> PII;
const int N = 1e5+7;
const int mod = 998244353;
int n,m,k;
int qmi(int x,int y){
    int res=1;
    while(y){
        if(y&1) res*=x;
        y>>=1;
        x*=x;
    }return res;
}

void sovle(){
    cin>>n;
    string s;
    for(int i=qmi(2,34);i>0;i>>=1){
        if((i&n)){
            while(i){
                n^=i;
                i>>=1;
            }
            break;
        }
    }
    for(int i=1;i<=qmi(2,32);i<<=1){
        if(i&n) s.push_back('1');
        else s.push_back('0');
    }
    int sum=0;
    for(int i=qmi(2,31),j=0;i;j++,i>>=1){
        if(s[j]=='1') sum+=i;
    }cout<<sum<<endl;
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

E-L1-5 演唱会_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
using namespace std;
typedef pair<int, int> PII;
const int N = 1e5+7;
const int mod = 998244353;
int n,m,k;


void sovle(){
    scanf("%d:%d:%d",&n,&m,&k);
    k+=33;if(k>=60) m++; k%=60;
    m+=22;if(m>=60) n++; m%=60; n+=1;
    if(n<19) cout<<"arrive on time";
    else if(n>=19&&n<21) cout<<"arrive late";
    else cout<<"too late";
}

signed main()
{	
    //ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

F-L1-6 分鸽子_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
using namespace std;
typedef pair<int, int> PII;
const int N = 1e5+7;
const int mod = 998244353;
int n,m,k;
int a[100055];

bool ok(int x){
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=a[i]/x;
    }
    return sum>=m;
}

void sovle(){
    cin>>n>>m;
    for(int i=0;i<n;i++) cin>>a[i];
    int l=1,r=INT_MAX,ans=0;
    while(l<=r){
        int mid=(l+r)>>1;
        if(ok(mid)){
            ans=mid;
            l=mid+1;
        }else r=mid-1;
    }cout<<ans<<endl;
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

G-L1-7 拼接梯子_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
using namespace std;
typedef pair<int, int> PII;
const int N = 1e5+7;
const int mod = 998244353;
int n,m,k;

int qmi(int x,int y){
    int res=1;
    while(y){
        if(y&1)res*=x;
        y>>=1;
        x*=x;
    }return res;
}

void sovle(){
    cin>>n>>m;
    int max1=0;
    for(int i=2;i<=qmi(2,n);i<<=1){
        if(i&m){
            m-=i;
            max1=max(max1,i);
        }
    }
    if(!m){
        cout<<"Yes"<<endl;cout<<max1;
    }else cout<<"No";
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

I-L2-1 特殊的沉重球_武汉工程大学2020GPLT选拔赛(重现赛)(重现赛)@IR101 (nowcoder.com)

#include<bits/stdc++.h>
#define endl '\n'
#define mk make_pair
#define int long long
using namespace std;
typedef pair<int, int> PII;
const int N = 2e5+10;
int n,m,k,ans=30;
int a[24];
int b[24];

void dfs(int i, int num){
    if(num>=ans) return;
    if(i>=n) {ans=min(ans,num);return;}
    for(int j=0;j<num;j++){
        if(a[i]+b[j]<=m){
            b[j]+=a[i];
            dfs(i+1,num);
            b[j]-=a[i];
        }
    }
    b[num]+=a[i];
    dfs(i+1,num+1);
    b[num]-=a[i];
}

void sovle(){
    cin>>n>>m;
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a,a+n,greater<int>());
    dfs(0,0);
    cout<<ans<<endl;
}

signed main()
{	
    ios::sync_with_stdio(false), cin.tie(0),cout.tie(0); 
    int t = 1;
    //cin>>t;
    while (t--){
        sovle();
    }

    return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值