上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
摘要: 第一次参加codeforces比赛,只能做出来俩题,第三个题思路也就一半一半,估计是想不出来的那种,赛后问了下带佬,把我思路添加了点,最终还是A了 争取稳过第三题! //A //统计1,-1出现的次数,然后如果-1是奇数,让他变成偶数,次数+1 //因为总乘积要是正1,然后再变-1为1,直到>=0为 阅读全文
posted @ 2023-06-19 09:24 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(0)
摘要: kmp算法用于优化字符串匹配效率: //KMP字符串匹配: //模板: #include<bits/stdc++.h> using namespace std; const int N=1e6+10; char s1[N],s2[N]; int ne[N],n,res; int main() { s 阅读全文
posted @ 2023-06-18 20:34 o-Sakurajimamai-o 阅读(47) 评论(0) 推荐(0)
摘要: 【题面】 你决定用素数定理来做一个调查. 众所周知, 素数又被称为质数,其含义就是除了数字一和本身之外不能被其他任何的数字除尽. 现在给定一个正整数序列 ,+1,⋯ ,a,a+1,⋯,b (≤)(a≤b), 请找出一个最小值 l, 使其满足对于任意一个长度为 l 的子串, 都包含 k 个质数. 找到 阅读全文
posted @ 2023-06-18 10:17 o-Sakurajimamai-o 阅读(27) 评论(0) 推荐(0)
摘要: 弱化版:黑虎阿福: 题目描述 阿福是一名经验丰富的大盗。趁着月黑风高,阿福打算今晚洗劫一条街上的店铺。 这条街上一共有 NNN 家店铺,每家店中都有一些现金。阿福事先调查得知,只有当他同时洗劫了两家相邻的店铺时,街上的报警系统才会启动,然后警察就会蜂拥而至。 作为一向谨慎作案的大盗,阿福不愿意冒着被 阅读全文
posted @ 2023-06-17 18:29 o-Sakurajimamai-o 阅读(14) 评论(0) 推荐(0)
摘要: 之前的二分大多数都是整数类型的,今天又学到一种新型的二分,浮点数的二分,浮点数的二分可太巧妙了.且听我细细分说::OpenJudge - 2018:Best Cow Fences #include<bits/stdc++.h> using namespace std; const int N=1e5 阅读全文
posted @ 2023-06-17 10:13 o-Sakurajimamai-o 阅读(57) 评论(0) 推荐(0)
摘要: 【日报】差分与前缀和,但是加上了一些拓展 - 白色过膝袜 - 洛谷博客 (luogu.com.cn) 预计学习时间: 一天 因为发现有好多题目都需要利用前缀和还有差分来进行优化,所以要花一天的时间把这种基础算法学完. //前缀和: //二维前缀和: //1-1 激光炸弹: https://www.l 阅读全文
posted @ 2023-06-16 22:25 o-Sakurajimamai-o 阅读(40) 评论(0) 推荐(0)
摘要: Edgy Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a tree (a conne 阅读全文
posted @ 2023-06-16 15:31 o-Sakurajimamai-o 阅读(25) 评论(0) 推荐(0)
摘要: 附加强版链接(待做):Mr. Kitayuta's Colorful Graph - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) Mr. Kitayuta's Colorful Graph time limit per test 1 second memory limit per 阅读全文
posted @ 2023-06-16 13:31 o-Sakurajimamai-o 阅读(24) 评论(0) 推荐(0)
摘要: C. Present time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little beaver is a beginner p 阅读全文
posted @ 2023-06-15 14:21 o-Sakurajimamai-o 阅读(26) 评论(0) 推荐(0)
摘要: C. Even Number Addicts time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Alice and Bob are 阅读全文
posted @ 2023-06-14 17:26 o-Sakurajimamai-o 阅读(44) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 21 下一页
-- --