M-SOLUTIONS Programming Contest 2020总结
程序员文章站
2024-01-09 20:13:10
A - Kyu in AtCoder直接模拟#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)#define debug(x) cout<<#x<<": "<#includeusing namespace std;int main(){ IO; int x;...
A - Kyu in AtCoder
直接模拟
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define debug(x) cout<<#x<<": "<<x<<" "
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
IO;
int x;
cin>>x;
//cout<<10-x/200<<endl;标准答案
if(x<=599) cout<<'8'<<endl;
else if(x<=799) cout<<'7'<<endl;
else if(x<=999) cout<<'6'<<endl;
else if(x<=1199) cout<<'5'<<endl;
else if(x<=1399) cout<<'4'<<endl;
else if(x<=1599) cout<<'3'<<endl;
else if(x<=1799) cout<<'2'<<endl;
else cout<<'1'<<endl;
return 0;
}
B - Magic 2
贪心
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define debug(x) cout<<#x<<": "<<x<<" "
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
IO;
int a,b,c,k;
cin>>a>>b>>c>>k;
int cnt=0;
while(b<=a)
{
b*=2;
cnt++;
}
while(c<=b)
{
c*=2;
cnt++;
}
if(cnt<=k) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
C - Marks
比较一下就可以了
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define debug(x) cout<<#x<<": "<<x<<" "
#include<iostream>
#include<algorithm>
using namespace std;
const int N=200010;
int a[N];
int main()
{
IO;
int n,k;
cin>>n>>k;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=k+1;i<=n;i++)
{
if(a[i]>a[i-k]) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
D - Road to Millionaire
贪心:有钱就赚,低买高卖
#define IO ios::sync_with_stdio(false);cin.tie();cout.tie(0)
#define debug(x) cout<<#x<<": "<<x<<" "
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const int N=100;
int a[N],n;
int main()
{
IO;
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
ll res=1000;
for(int i=1;i<=n;i++)
if(i<=n&&a[i+1]>=a[i])res=res/a[i]*a[i+1]+res%a[i];
cout<<res<<endl;
return 0;
}
只能做这些容易题~~嗨,要加油哦!
本文地址:https://blog.csdn.net/Fighting_Peter/article/details/107594942
上一篇: 求解一路题
下一篇: PHP判断url链接是否被百度收录
推荐阅读
-
M-SOLUTIONS Programming Contest 2020总结
-
2020年3月21日Benelux Algorithm Programming Contest 2019
-
ICPC NEAU Programming Contest 2020 D 旅游(单调栈)
-
2020年3月28日UCF Local Programming Contest 2016
-
2020年04月10日UCF Local Programming Contest 2017
-
L Clock Master(2020 China Collegiate Programming Contest Weihai Site)补题
-
atcoder:Tokio Marine & Nichido Fire Insurance Programming Contest 2020:E - O(rand)(位运算+二项式反演)
-
2020年3月21日Benelux Algorithm Programming Contest 2019
-
ICPC NEAU Programming Contest 2020 H 排序
-
ICPC NEAU Programming Contest 2020 I. 支付(拆分数)