D题题解
反思
一开始暴力,没想到LIS qwq,(但是发现了是可以操作1+操作2达到 调整位置)
- LIS
E题题解
反思
- 循环节.(和排序有关)
- 之后转换成lcm
- 大数
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;
}