当前位置:网站首页>Acwing game 60
Acwing game 60
2022-07-19 13:35:00 【leimingzeOuO】
AcWing 4494. having dinner
simulation
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps=1e-5;
#define x first
#define y second
#define LL long long
#define int LL
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define ll_INF 0x7f7f7f7f7f7f7f7f
#define INF 0x3f3f3f3f
#define debug(x) cerr << #x << ": " << x << endl
#define io ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
int Mod(LL a,LL mod){
return (a%mod+mod)%mod;}
int lowbit(LL x){
return x&-x;}// Its lowest 1 And behind it 0 The value of composition
//void read(__int128 &x){char c = getchar();while (c != '-' & (c < '0' | c > '9'))c = getchar();if (c == '-') {c = getchar();while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}x = 0 - x;} else {while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}}}
//void out(__int128 x) {string c = "";while (x) {c += x % 10 + '0';x /= 10;}reverse(c.begin(), c.end());cout << c << endl;}
int qmi(int a, int k, int p){
int res = 1 % p;while (k){
if (k & 1) res = Mod(res * a , p);a = Mod(a * a , p);k >>= 1;}return res;}
int _;
int n,m,k;
void solve()
{
cin>>n>>m>>k;
int h=min(m,k);
if(h>=n)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
signed main()
{
io;
//cin>>_;
//while(_--)
solve();
return 0;
}
4495. Array operation
Double pointer simulated small top reactor
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps=1e-5;
#define x first
#define y second
#define LL long long
#define int LL
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define ll_INF 0x7f7f7f7f7f7f7f7f
#define INF 0x3f3f3f3f
#define debug(x) cerr << #x << ": " << x << endl
#define io ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
int Mod(LL a,LL mod){
return (a%mod+mod)%mod;}
int lowbit(LL x){
return x&-x;}// Its lowest 1 And behind it 0 The value of composition
//void read(__int128 &x){char c = getchar();while (c != '-' & (c < '0' | c > '9'))c = getchar();if (c == '-') {c = getchar();while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}x = 0 - x;} else {while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}}}
//void out(__int128 x) {string c = "";while (x) {c += x % 10 + '0';x /= 10;}reverse(c.begin(), c.end());cout << c << endl;}
int qmi(int a, int k, int p){
int res = 1 % p;while (k){
if (k & 1) res = Mod(res * a , p);a = Mod(a * a , p);k >>= 1;}return res;}
int _;
int n,k;
const int N=1e5+10;
int a[N];
void solve()
{
cin>>n>>k;
for(int i=1;i<=n;i++)cin>>a[i];
sort(a+1,a+1+n);
int cnt=0;
for(int i=1,j=1;i<=k;i++)
{
while(a[j]-cnt<=0&&j<=n)j++;
if(j<=n&&a[j]-cnt>0)
{
cout<<a[j]-cnt<<endl;
cnt+=a[j]-cnt;
}
else cout<<0<<endl;
}
}
signed main()
{
io;
//cin>>_;
//while(_--)
solve();
return 0;
}
4496. Eat fruit
Combinatorial number
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const double eps=1e-5;
#define x first
#define y second
#define LL long long
#define int LL
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define ll_INF 0x7f7f7f7f7f7f7f7f
#define INF 0x3f3f3f3f
#define debug(x) cerr << #x << ": " << x << endl
#define io ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
int Mod(LL a,LL mod){
return (a%mod+mod)%mod;}
int lowbit(LL x){
return x&-x;}// Its lowest 1 And behind it 0 The value of composition
//void read(__int128 &x){char c = getchar();while (c != '-' & (c < '0' | c > '9'))c = getchar();if (c == '-') {c = getchar();while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}x = 0 - x;} else {while (c >= '0' & c <= '9') {x = x * 10 + c - '0';c = getchar();}}}
//void out(__int128 x) {string c = "";while (x) {c += x % 10 + '0';x /= 10;}reverse(c.begin(), c.end());cout << c << endl;}
int qmi(int a, int k, int p){
int res = 1 % p;while (k){
if (k & 1) res = Mod(res * a , p);a = Mod(a * a , p);k >>= 1;}return res;}
int _;
int n,m,k;
const int mod=998244353;
const int N=2010;
int c[N][N];
void init()
{
for(int i=0;i<=2000;i++)
for(int j=0;j<=i;j++)
{
if(!j)c[i][j]=1;
else c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod;
}
}
void solve()
{
init();
cin>>n>>m>>k;
cout<<m*qmi((m-1),k,mod)%mod*c[n-1][k]%mod<<endl;
}
signed main()
{
io;
//cin>>_;
//while(_--)
solve();
return 0;
}
边栏推荐
- [record of question brushing] 13 Roman numeral to integer
- (PC+WAP)织梦模板服装礼服类网站
- 健康防猝指南3:健康保健
- [Yugong series] July 2022 go teaching course 012 forced type conversion
- 弹性负载均衡将访问流量自动分发到多台云服务器,扩展应用系统对外的服务能力,提高应用程序安全性。
- 【码蹄集新手村 600 题】如何使整数逆序
- Wrong again, byte alignment and the use of pragma pack
- Advanced C language -- character function and string function
- onvif协议相关:3.1.2 Digest方式获取token列表
- Onvif protocol related: 3.1.1 digest access authorization
猜你喜欢
![Codeforce:g. good key, bad key [greed]](/img/5e/e34e549c15e2e495d3a274ea8e6f82.png)
Codeforce:g. good key, bad key [greed]

onvif协议相关:3.1.4 Digest方式获取流地址

Onvif protocol related: 4.1.2 WS username token method to obtain token

Onvif protocol related: 4.1.4 WS username token method to obtain the stream address

onvif协议相关:3.1.3 Digest方式获取截图url

Unveiling secrets of matrixcube 101 - functions and architecture of matrixcube

如何优雅的升级 Flink Job?

LeetCode 0565.数组嵌套:转换为图 + 原地修改の优化

每周小结(*65):有计划的输出

忘掉Postman,Apifox更好用
随机推荐
Unveiling secrets of matrixcube 101 - functions and architecture of matrixcube
A general memory management driver code is sorted out
onvif协议相关:2.1.1 none方式获取token
VMware imports ova/ovf virtual machine files
深度学习从入门到放弃100天挑战
【码蹄集新手村 600 题】针对于字符串的格式化控制,即字符串的宽度与精度
onvif协议相关:3.1.2 Digest方式获取token列表
Running node for getting started with eth
jvm自学总结
onvif协议相关:4.1.4 WS-Username token方式获取流地址
弘业期货网上开户安全吗?有没有开户指引?
(PC+WAP)织梦模板服装礼服类网站
【码蹄集新手村 600 题】科学计数法的实现方式,输出指数形式
【码蹄集新手村 600 题】运算符 / 在不同的运算顺序中的类型转换
名片管理的框架搭建
【7.14】代码源 -【拆方块】【XOR Inverse】【连续子序列】【三角果计数】
命令行的一些常用操作命令及常见错误的解决办法
【腾讯蓝鲸】第七届 7·24 运维日节日祝福送上~ 快来许愿~
Flutter uses animatedswitcher to switch scenes
Use golang to correctly process the IP data of the five major Internet registration agencies