2020牛客暑期多校训练营(第五场)D--E--F--I

D题题解

反思

一开始暴力,没想到LIS qwq,(但是发现了是可以操作1+操作2达到 调整位置)

  1. LIS

E题题解

反思

  1. 循环节.(和排序有关)
  2. 之后转换成lcm
  3. 大数

F----DPS(简单模拟)

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

牛客官方题解(签到,就不写题解了)

在这里插入图片描述

反思

一开始爆了·int。下次看清楚点数据范围再交题目。

AC

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int n;
ll a[200];
int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n;
    int maxx=0;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        maxx=max(maxx,a[i]);
    }
    for(int i=1; i<=n; i++)
    {
        int flag=0;
        if(a[i]==maxx)flag=1;
        int sp=(a[i]*50+maxx-1)/maxx;
        for(int j=1; j<=sp+2; j++)
        {
            if(j==1||j==sp+2)cout<<'+';
            else cout<<'-';
        }
        cout<<endl;
        for(int j=1; j<=sp+2; j++)
        {
            if(j==1||j==sp+2)cout<<'|';
            else if(flag&&j==sp+1)cout<<'*';
            else cout<<' ';
        }
        cout<<a[i];
        cout<<endl;
        for(int j=1; j<=sp+2; j++)
        {
            if(j==1||j==sp+2)cout<<'+';
            else cout<<'-';
        }
        cout<<endl;
    }
    return 0;
}

I----Hard Math Problem(极限,有点类似化学算结构。)

在这里插入图片描述
在这里插入图片描述

AC

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    printf("%.6f\n",2.0/3);
    return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值