当前位置: 首页 > news >正文

怎么给别人做网站网站天津网站建设美丽

怎么给别人做网站网站,天津网站建设美丽,erp软件免费版,如何网上建设网站文章目录 A - 三角形B - 好数组C - 前缀平方和序列D - 走一个大整数迷宫E - 前缀和前缀最大值 A - 三角形 map存一下每个数出现了多少次#xff0c;再遍历map #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pair再遍历map #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pairint, int PII; typedef pairint, char PIC; typedef pairdouble, double PDD; typedef pairint, PII PIII; typedef pairint, pairint, bool PIIB;const int N 1e5 10; const int maxn 1e6 10; const int mod 998244353; const int mod1 954169327; const int mod2 906097321; const int INF 0x3f3f3f3f3f3f3f3f;void solve() {int n;cin n;mapint, int mp;for (int i 0; i n; i ){int x; cin x;mp[x] ;}for (auto t : mp){if (t.second 3){cout YES\n;return;}}cout NO\n;return; }signed main() {ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t 1; // cin t;while (t--){solve();} }B - 好数组 数组没有 0 就是好数组 #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pairint, int PII; typedef pairint, char PIC; typedef pairdouble, double PDD; typedef pairint, PII PIII; typedef pairint, pairint, bool PIIB;const int N 1e5 10; const int maxn 1e6 10; const int mod 998244353; const int mod1 954169327; const int mod2 906097321; const int INF 0x3f3f3f3f3f3f3f3f;void solve() {int n;cin n;vectorint a(n 1);for (int i 1; i n; i ) cin a[i];for (int i 1; i n; i ){if (a[i] 0){cout NO\n;return;}}cout YES\n; }signed main() {ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t 1;// cin t;while (t--){solve();} }C - 前缀平方和序列 对 x 开方得到的就是能存在数组里的所有数的个数我们要取 n 个也就是 C(sqrt(x), n) #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pairint, int PII; typedef pairint, char PIC; typedef pairdouble, double PDD; typedef pairint, PII PIII; typedef pairint, pairint, bool PIIB;const int N 1e5 10; const int maxn 1e6 10; const int mod 1e9 7; const int mod1 954169327; const int mod2 906097321; const int INF 0x3f3f3f3f3f3f3f3f;int Jc[maxn 1];void calJc() //求 maxn 以内的数的阶乘 不知道开多少就1e6吧爆不了 {Jc[0] Jc[1] 1;for(int i 2; i maxn; i) Jc[i] Jc[i - 1] * i % mod; }int pow(int a, int n, int p) // 快速幂取模 {int ans 1;while (n){if (n 1) ans ans * a % p;a a * a % p;n 1;}return ans; }int niYuan(int a, int b) //费马小定理求逆元 {return pow(a, b - 2, b); }int C(int a, int b) // 组合数 {if(a b) return 0;return Jc[a] * niYuan(Jc[b], mod) % mod * niYuan(Jc[a - b], mod) % mod; }void solve() {calJc();int n, x;cin n x;int cnt sqrt(x);int ans C(cnt, n);cout ans \n; }signed main() {ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t 1;// cin t;while (t--){solve();} }D - 走一个大整数迷宫 首先需要注意到 c 的值和 b 一点关系都没有因为 b 不可能对 (p - 1) 有任何贡献 明确这一点之后只需要 bfs 就可以了注意需要判断 st[x][y][k] 不重复(x, y) 就是点坐标k 就是到达该点的余数 #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pairint, int PII; typedef pairint, char PIC; typedef pairdouble, double PDD; typedef pairint, PII PIII; typedef pairint, pairint, bool PIIB;const int N 1e5 10; const int maxn 1e6 10; const int mod 1e9 7; const int mod1 954169327; const int mod2 906097321; const int INF 0x3f3f3f3f3f3f3f3f;int dx[4] {0, 0, 1, -1}, dy[4] {1, -1, 0, 0};struct node {int dist, res, x, y; };void solve() {int n, m, p;cin n m p;vectorvectorint a(n 1, vectorint(m 1)), b(n 1, vectorint(m 1));for (int i 1; i n; i )for (int j 1; j m; j )cin a[i][j];for (int i 1; i n; i )for (int j 1; j m; j )cin b[i][j];int ans INF;queuestruct node q;q.push({0, a[1][1] % (p - 1), 1, 1});vectorvectorvectorbool st(n 1, vectorvectorbool(m 1, vectorbool(p 1)));while (q.size()){auto t q.front();q.pop();if (st[t.x][t.y][t.res]) continue;st[t.x][t.y][t.res] true;if (t.x n t.y m t.res % (p - 1) 0){cout t.dist \n;return;}if (t.dist 1e6){cout -1 \n;return;}for (int i 0; i 4; i ){int nx t.x dx[i], ny t.y dy[i];if (nx 0 || nx n || ny 0 || ny m) continue;q.push({t.dist 1, (t.res a[nx][ny]) % (p - 1), nx, ny});}} }signed main() {ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t 1;// cin t;while (t--){solve();} }E - 前缀和前缀最大值 a 的前缀最大值数量最多的情况就是把正数全都排在前面的时候此时数量为 正数个数1加的 1 代表最前面的前缀和 0 数量最少的情况就是把负数全都排在正数前面且正数从小到大排列这种情况怎么计算呢因为 b 的值域最大只有100所以用 cnt_pos[i][j] 表示前 i 个元素中 j 出现的次数之后计算最多需要多少个正数可以把负数都抵消即可 答案就是最大值-最小值1 #include bits/stdc.husing namespace std;#define int long long using i64 long long;typedef pairint, int PII; typedef pairint, char PIC; typedef pairdouble, double PDD; typedef pairint, PII PIII; typedef pairint, pairint, bool PIIB;const int N 10; const int maxn 1e6 10; const int mod 998244353; const int mod1 954169327; const int mod2 906097321; const int INF 0x3f3f3f3f3f3f3f3f;void solve() {int n;cin n;vectorint a(n 1), pre_neg(n 1);vectorvectorint cnt_pos(n 1, vectorint(110));for (int i 1; i n; i ){cin a[i];pre_neg[i] pre_neg[i - 1] - min(a[i], (i64)0);for (int j 1; j 100; j ){cnt_pos[i][j] cnt_pos[i - 1][j] (a[i] j);}} int q;cin q;while (q -- ){int l, r;cin l r;int cnt_plus 0; // 正数个数for (int i 1; i 100; i ) cnt_plus cnt_pos[r][i] - cnt_pos[l - 1][i];int sum_tmp 0; // 当前正数之和int cnt_need 0; // 需要多少正数和负数抵消for (int i 1; i 100; i ){int cnt cnt_pos[r][i] - cnt_pos[l - 1][i];if (sum_tmp i * cnt (pre_neg[r] - pre_neg[l - 1])){cnt_need (pre_neg[r] - pre_neg[l - 1] - sum_tmp) / i;break;}else{cnt_need cnt;sum_tmp cnt * i;}}cout cnt_plus 1 - (cnt_plus - cnt_need 1) 1 \n;} }signed main() {ios::sync_with_stdio(false);cin.tie(0), cout.tie(0);int t 1;// cin t;while (t--){solve();} }
http://www.hkea.cn/news/14539860/

相关文章:

  • 查企业资质上什么网站网站建设 风险说明
  • 滕州建网站网站导航上的图片做多大尺寸
  • 网页设计网站期末作业wordpress后台配置文件
  • 怎么看网站有没有被k外贸公司网站如何免费推广
  • 做交友信息网站可行么自定义网址生成器
  • 什么网站可以做论文在网站上怎么做推广
  • 制作html购物网站源代码微网站是什么时候创建的
  • 有哪些做公司网站个人建网站成本
  • 营销团队网站建设设计logo网站有哪些免费
  • 萌宝宝投票网站怎么做产品推广渠道有哪些
  • phpcms v9 网站搬家wordpress主题淘客
  • 宁波做网站多少钱英国有哪些做折扣的网站
  • 景区网站设计学校网站建设机构
  • 如何查看一个网站是用什么程序做的wordpress后台目录无法访问
  • 网站建设外包质量进度跟进使用二级域名会影响网站收录
  • 长春网站排名优化公司织梦企业网站
  • 网站建设营销方案定制php网站挂到linux服务器上应该这么做
  • 设计最简单的企业网站广州网页设计软件培训
  • 公司网站建设与维护东莞专业网站建站设计
  • 建网站找哪家好南宁做网站
  • 广西柳州做网站wordpress js插件开发教程视频
  • 中小企业建站服务建设一个视频网站己18
  • 做PPT哪个网站的素材多点什么专业学网页设计
  • 给人做网站互联网舆情
  • 做的网站怎么联网生态环境工程公司网站建设
  • 抖音上做我女朋友网站网站二次开发公司
  • 网站建设怎么做账东莞建设网站平台
  • 兰州做网站维护的公司简单网站开发准备
  • 江宁区建设工程局网站进不去剪辑教学课程
  • 个体搞网站建设 经营范围app取代网站