AtCoder Beginner Contest 375 省流版 A. 枚举所有子串判断即可 B. 模拟计算记录累加即可 C. 根据旋转的周期性对每个点旋转次数取模后暴力旋转即可 D. 枚举kk,考虑 i,ji,j的对数,写成数学表达式后维护个数和位置和即可 E. 背包问题,以前两个数组和为状态,考虑每个数移动到何处转移即可 F. 逆向,删边变加...
化简之后会发现,如果从某个位置算的话,这部分答案就是下一个位置的值后缀和-(总长度 - 当前位置 )* (当前位置的值 + 1),在图上也就是所有蓝色区间的答案。 注意这个例子仅仅示例了对于字符A来说从1号为A开始的答案贡献,后面位置的也是同理,所以上面程序里面,是遍历了1到len - 1的每一个位置的( 也就...
using namespace std; string s; int ans,N; int main() { cin>>N; cin>>s; for(int i=1;i<s.size()-1;i++) { if(s[i]=='.' and s[i-1]=='#' and s[i+1]=='#') ans++; } cout<<ans; return 0; } B #include<bits/stdc++.h> #define int long long using namespace...
int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); int n; std::cin >> n; std::string s; std::cin >> s; int ans = 0; for (int i = 0; i + 2 < n; i++) { if (s.substr(i, 3) == "#.#") { ans++; } } std::cout << ans << '\n'; ret...
AtCoder Beginner Contest 376(A ~ F 题讲解), 视频播放量 481、弹幕量 2、点赞数 23、投硬币枚数 14、收藏人数 4、转发人数 1, 视频作者 蒟蒻小史, 作者简介 QQ 群:632491357,相关视频:AtCoder Beginner Contest 378(A ~ F 题讲解),AtCoder Beginner Contest 370(
Σ 大赛——AtCoder Beginner Contest 353 https://www.bilibili.com/video/BV1kt421u7XK/ https://www.bilibili.com/video/BV1vf42127tH/ AtCoder Beginner Contest 353 实况(A~E) https://www.bilibili.com/video/BV1Gs421N748/ https://www.bilibili.com/video/BV19E42137MQ/ AtCoder Beginner Cont...
AtCoder Beginner Contest 053 ABCD题 A - ABC/ARC Time limit : 2sec /Memory limit : 256MB Score :100points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than1200, and participate in AtCoder Regular Contest (ARC) otherwise...
AtCoder Beginner Contest 193 部分题解 E - Oversleeping 求是否存在\(t\)满足\(t=t_1(mod (2X+2Y)) and t=t_2(mod (P+Q))\) 注意到\(Q\)和\(Y\)非常小,直接枚举套个\(exCRT\)就行了(虽然赛场上没看出来,\(exCRT\)也忘了记得快速乘...
AtCoder Beginner Contest 273的C题是否需要使用动态规划来解决? A - A Recursive Function Origional Link 题目大意: 求f(k) 如下: f(0)=1; f(k)=k×f(k−1) 思想: 签到题。 代码: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 #include <iostream> #include <cstring> #include <cstdio...
题解与反思 第一次打Rating,被薄纱!!! A - Buildings #include using namespace std; typedef long long LL; const int mod = 998244353; const int N_牛客网_牛客在手,offer不愁