Acwing第 60 场周赛【完结】
60 AcWing 周赛 完结
2023-09-11 14:15:52 时间
https://www.acwing.com/activity/content/competition/problem_list/2048/
4494. 吃饭
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a,b,c; cin>>a>>b>>c;
if(b>=a&&c>=a) puts("Yes");
else puts("No");
return 0;
}
4495. 数组操作【模拟】
#include<bits/stdc++.h>
using namespace std;
const int N=1e5*4+10;
typedef long long int LL;
LL a[N],n,m,sum;
priority_queue<int,vector<int>,greater<int>>q;
int main(void)
{
cin>>n>>m;
for(int i=1;i<=n;i++) cin>>a[i],q.push(a[i]);
while(m--)
{
while(q.size()&&q.top()-sum<=0) q.pop();
if(q.size())
{
cout<<q.top()-sum<<endl;
sum+=q.top()-sum;
}else cout<<0<<endl;
}
return 0;
}
4496. 吃水果【DP】
#include<bits/stdc++.h>
using namespace std;
const int N=2010;
const int mod=998244353;
typedef long long int LL;
LL f[N][N],n,m,k;
int main(void)
{
cin>>n>>m>>k;
f[1][0]=m;
for(int i=2;i<=n;i++)
{
for(int j=0;j<=k&&j<i;j++)
{
f[i][j]=f[i-1][j];
if(j) f[i][j]=(f[i][j]+f[i-1][j-1]*(m-1))%mod;
}
}
cout<<f[n][k];
return 0;
}
相关文章
- LeetCode(60): 第k个排列
- 借助 Java 9 Jigsaw,如何在 60 秒内创建 JavaFX HelloWorld 程序?
- Vue.js——60分钟快速入门
- LeetCode(60): 第k个排列
- Qt编写自定义控件60-声音波形图
- 习题 3.11 给出一个百分制的成绩,要求输出成绩等级'A','B','C','D','E'。90分以上为'A',80~89分为'B',70~79分为'C',60~69分为'D',60分以下为'E'。
- 60集Python入门视频PPT整理 | Python迭代器和列表解析
- 60集Python入门视频PPT整理 | Python流程控制
- Windows API一日一练(60)CreateIoCompletionPort和GetQueuedCompletionStatus函数
- Vue.js——60分钟快速入门