
AtCoder
ggbooo
这个作者很懒,什么都没留下…
展开
-
c++判断是否属于一个字符串的子串
AtCoder - abc230_b题意:一个字符串T有n多个oxx组成,输入字符串S,判断S是否为T的子串这介绍两种方法,枚举和调用库函数:暴力枚举:#include<bits/stdc++.h>using namespace std;const int maxn=1e5+10;typedef long long ll;ll n;vector<pair<int,int> >line;string t = "oxx";char a[15];int原创 2022-03-25 16:25:50 · 3863 阅读 · 0 评论 -
AtCoder - abc233_d
题意,给定n个数,m。求n个数中有多少连续的区间和等于m题解:用前缀和优化,mp数组记录值,要开long long 不然wa代码:#include <bits/stdc++.h>#define endl "\n"#define rep(i, m, n) for (int i = (m); i <= (n); ++i)#define rrep(i, m, n) for (int i = (m); i >= (n); --i)#define IOS ios::sync_wi原创 2022-01-27 13:38:41 · 663 阅读 · 0 评论 -
AtCoder abc233_c题解
题意:给你N个包,每个包里n个值,从每个包里取一个数,要求这N个数乘积等于X,问有多少种这样的情况。思路:深搜,首先我们可以想到设置当前值为1,然后乘每一层的数,然 0<ai < 1e9这样乘到最后可能超long long ,所以设初始值为X,向下除,除到1 return。代码#include <bits/stdc++.h>#define endl "\n"#define rep(i, m, n) for (int i = (m); i <= (n); ++i)#原创 2022-01-26 18:20:22 · 726 阅读 · 0 评论