AtCoder Beginner Contest 177 比赛链接:https://atcoder.jp/contests/abc177/tasks A - Don't be late #include <bits/stdc++.h> using namespace std; int main() { int d, t, s; cin >> d >> t >> s; cout << (t * s >= d ? "Yes" : "No") << "\n"; } B - Substring ...
B - Substring 注意到S和T长度很小,所有可以枚举 int main() { ios_base::sync_with_stdio(false), cin.tie(0); string s, t; cin >> s >> t; int n = s.size(), m = t.size(); int ans = m; for (int start = 0; start <= n - m; ++start) { int cnt = 0; for (int ...
B.Substring 题意: 给你两个字符串 s,ts,t,问你最少更改 ss 几次能使得 tt 是ss 的字串。 题解: 因为字符串长度小于 10001000 直接暴力枚举 tt 出现在 ss 的什么位置。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25#include <cstdio> #include <cstring> ...
ABC174B - Distance PythonC - Repsept PythonD - Alter Altar Python ABC175C - Walking Takahashi Python ABC176B - Multiple of 9 Python ABC177B - Substring PythonC - Sum of product of pairs Python ABC178C - Ubiquity Python ABC179C - A x B + C ...
总的显然等于 \(num(R)*num(B)*num(G)\) ,然后枚举两个端点,判断第三个端点是不是不同于这个两个端点的颜色。 constintN=4e3+5; intmain(){ ios::sync_with_stdio(false),cin.tie(nullptr); intn;strings; cin>>n>>s; inta=0,b=0,c=0; ...
AtCoder Grand Contest。简称 AGC,大师赛。 还会有一些企业竞赛。 已经完成的题目 AtCoder Beginner Contest ABC177 题号题目链接AC参考代码 A题 Don't be late https://atcoder.jp/contests/abc177/tasks/abc177_a https://github.com/zhouyium/AtCoder/blob/master/ABC177/a.cpp B题 Substring https://...
B - Substring注意到 S 和T 长度很小,所有可以枚举int main() { ios_base::sync_with_stdio(false), cin.tie(0); string s, t; cin >> s >> t; int n = s.size(), m = t.size(); int ans = m; for (int start = 0; start <= n - m; ++start) { int cnt = 0; for (int...
AtCoder Regular Contest 097 摘要:"传送门" C K th Substring 题意: 给出一个字符串,求其第kk小子串,k≤5k≤5。 思路: 因为kk很小,所以答案长度不可能超过kk。所以直接将所有的长度不超过kk的串拿出来排序就行。 Code cpp include define MP make_pair def 阅读全文 posted @ 2019-10-23 14:17 ...
ABC170 B - Crane and TurtlePython C - Forbidden ListPython ABC171 B - Mix JuicePython ABC174 B - DistancePython C - RepseptPython D - Alter AltarPython ABC175 C - Walking TakahashiPython ABC176 B - Multiple of 9Python ABC177 B - Substring Python C - Sum of product of pairs...