1 条题解
-
0
自动搬运
来自洛谷,原作者为

Clare613
csacademy.com||宣:https://www.luogu.com.cn/team/103922||250粉后橙名就别找我了||目标一:黄+绿+蓝+紫+黑->431/888||目标二:2025J:320+,2025S:250+||个人题库已满搬运于
2025-08-24 23:14:45,当前版本为作者最后更新于2025-04-26 14:00:16,作者可能在搬运后再次修改,您可在原文处查看最新版自动搬运只会搬运当前题目点赞数最高的题解,您可前往洛谷题解查看更多
以下是正文
思路
纯模拟,找到这面旗帜长什么样,统计 A 的数量即可,我们可以用 来确认这是第几个字母,在为 或 时即为 A。
#include<bits/stdc++.h> using namespace std; int cnt=0,ans=0; signed main(){ cin.tie(0)->sync_with_stdio(0); int h,w; cin>>h>>w; for(int i=1;i<=h;i++){ cnt=(i-1)%7; for(int j=1;j<=w;j++){ cnt++; if(cnt==8) cnt=1; if(cnt==2||cnt==6) ans++; } } cout<<ans; return 0; }
- 1
信息
- ID
- 12175
- 时间
- 1000ms
- 内存
- 512MiB
- 难度
- 2
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者