当前位置:网站首页>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;
}
边栏推荐
- Onvif protocol related: 3.1.2 get the token list in digest mode
- S32K148_ Can drive (bare metal development)
- 模块7(王者荣耀商城异地多活架构设计)
- How to upgrade Flink job gracefully?
- CMOS switch learning (I)
- [pyGame learning notes] 5 Collision detection of rect objects
- 面试官:可以接受转Go吗?
- onvif协议相关:2.1.3 none方式获取流地址
- 【码蹄集新手村 600 题】针对于字符串的格式化控制,即字符串的宽度与精度
- Using the case statement will produce a latch condition
猜你喜欢

Onvif protocol related: 2.1.2 get screenshot URL in none mode

onvif協議相關:4.1.3 WS-Username token方式獲取截圖url

使用case语句时会产生锁存器的情况

sqli-labs(less-11)

Flutter uses animatedswitcher to switch scenes
![[Yugong series] July 2022 go teaching course 012 forced type conversion](/img/7d/79f3e3e9fc73ee860b9607b7ebbb84.png)
[Yugong series] July 2022 go teaching course 012 forced type conversion
![[micro Service ~ advanced] configuration center practice](/img/6f/e365a93be7ed9cceafecf7c506965a.png)
[micro Service ~ advanced] configuration center practice

Responsive dream weaving template wine cellar website

onvif协议相关:2.1.3 none方式获取流地址
![Codeforce:a. difference operations [mathematical thinking]](/img/be/28bcb5dd8b9a36f2955f1912f289a3.png)
Codeforce:a. difference operations [mathematical thinking]
随机推荐
Interviewer: is it acceptable to transfer to go?
565. Array nesting
Flutter uses animatedswitcher to switch scenes
MySQL sort index failure?
Onvif protocol related: 4.1.2 WS username token method to obtain token
onvif协议相关:4.1.4 WS-Username token方式获取流地址
Health prevention guide 3: health care
力扣64-最小路径和——动态规划入门题型
Wrong again, byte alignment and the use of pragma pack
【码蹄集新手村 600 题】输出时的左对齐,右对齐
忘掉Postman,Apifox更好用
STL string输出与修改
mysql排序索引失效?
Atmospheric non isohalo effect
【7.15】代码源 -【整齐的数组2】【三进制循环】【树上逆序对】【蜗蜗的数列】
基于MOS管的防反接电路设计仿真
Onvif protocol related: common class description
Codeforce:a. doremy's IQ [reverse greed]
codeforce:A. Doremy‘s IQ【反向贪心】
命令行的一些常用操作命令及常见错误的解决办法