当前位置:网站首页>Acwing Week 63 [Unfinished]
Acwing Week 63 [Unfinished]
2022-08-08 16:32:00 【Fai little song】
https://www.acwing.com/activity/content/competition/problem_list/2128/
4503. 数对数量
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
int a,b,n; cin>>a>>b>>n;
int cnt=0;
for(int i=0;i<=a;i++)
for(int j=0;j<=b;j++) if(i+j==n) cnt++;
cout<<cnt;
return 0;
}
4504. 字符串消除【模拟】
#include<bits/stdc++.h>
using namespace std;
int main(void)
{
string s; cin>>s;
int sum=0;
stack<char>st;
for(int i=0;i<s.size();i++)
{
st.push(s[i]);
while(st.size()>=2)
{
auto a=st.top(); st.pop();
auto b=st.top(); st.pop();
if(a==b) sum++;
else
{
st.push(b),st.push(a);
break;
}
}
}
if(sum&1) puts("Yes");
else puts("No");
return 0;
}
边栏推荐
猜你喜欢
随机推荐
VIT:Transformer进军CV的里程碑
华为云分布式缓存服务Redis开通及使用规划教程【华为云至简致远】
暴力解决MySQL出现的莫名其妙的问题-重启服务!
R语言(数值、列表、矩阵)上应用函数(sqrt、round、mean、log)、将矩阵所有数据求对数、就矩阵整体的均值、使用apply函数计算矩阵matrix的行均值、列均值、trim设置返回结果精度
9.cuBLAS开发指南中文版--cuBLAS中的原子模式的配置
GPT3中文自动生成小说「谷歌小发猫写作」
非常菜的一个批量布置waf脚本
元宇宙医疗或将改变医疗格局
mmdetection最新版食用教程(一):安装并运行demo及开始训练coco
ImportError: numpy.core.multiarray failed to import [cv2, matplotlib, PyTorch, pyinstaller ]
[机缘参悟-64]:《兵者,诡道也》-5-孙子兵法解读-混战计
【LeetCode】试题总结:深度优先搜索 (DFS)
中金财富开户安全吗?怎么操作?
spark集群环境搭建
英特尔两大 FPGA 产品已部署至中国创新中心:性能提高 45%,功耗降低 40%
2022年中国全民健身发展白皮书
淘宝API常用接口列表与申请方式
耐心排序——专门快速解决最长递增子数组
Grid 布局介绍
最稳定的淘宝商品详情接口