合集-牛客竞赛
摘要:牛客小白月赛79 A. 数位dp? 解题思路: 如果开始就是偶数,那么直接不用变化。 如果开始不是偶数,那么个位数位上的数字一定不是偶数。换句话讲,只有个位数位上为偶数时,该数字才是偶数。 所以,一直闪末尾数位,直到该数位为偶数或者删完为止。 代码: #include <bits/stdc++.h>
阅读全文
摘要:牛客小白月赛81 A. 小辰打比赛 解题思路: 遍历找到小于 的数累加即可。 代码: #include<bits/stdc++.h> using namespace std; void solve() { int n,x; int ans = 0; cin >> n >> x; for(in
阅读全文
摘要:牛客小白月赛85 A ACCEPT 点击查看 943/1484 通过 B 咕呱蛙 点击查看 853/2130 通过 C 得分显示 点击查看 526/2489 通过 D 阿里马马与四十大盗 点击查看 269/1993 通过 E 烙饼 点击查看 56/322 通过 A 解题思路: 统计每个字符的数量,算
阅读全文
摘要:牛客小白月赛86 A 水盐平衡 解题思路: 通分,然后比较分子大小。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first
阅读全文
摘要:牛客周赛 Round 29 小红大战小紫 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first #define se sec
阅读全文
摘要:牛客练习赛121 出题人题解 | 牛客练习赛 121 题解 小念吹气球 解题思路: 字符长度加字符种类数。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>
阅读全文
摘要:牛客周赛 Round 31 小红小紫替换 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first #define se sec
阅读全文
摘要:牛客周赛 Round 32 小红的 01 背包 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first #define se
阅读全文
摘要:2024牛客寒假算法基础集训营1 A 解题思路: 按照 出现顺序暴力判断即可。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #defin
阅读全文
摘要:牛客小白月赛87 小苯的石子游戏 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first #define se second
阅读全文
摘要:牛客周赛 Round 34 小红的字符串生成 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; #define fi first #define se s
阅读全文
摘要:牛客周赛 Round 35 小红的字符串切割 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; typedef double db; #define fi
阅读全文
摘要:牛客周赛 Round 35 小红的字符串切割 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; typedef double db; #define fi
阅读全文
摘要:牛客小白月赛88 A 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, ll>; typedef double db; #define fi first #defi
阅读全文