随笔分类 -  Codeforces

摘要:Forever Winter time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A snowflake graph is gene 阅读全文
posted @ 2023-06-30 19:32 o-Sakurajimamai-o 阅读(35) 评论(0) 推荐(0) 编辑
摘要:Constructive Problem time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As you know, any pro 阅读全文
posted @ 2023-06-30 19:29 o-Sakurajimamai-o 阅读(26) 评论(0) 推荐(0) 编辑
摘要:Cake Assembly Line time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A cake assembly line i 阅读全文
posted @ 2023-06-29 11:54 o-Sakurajimamai-o 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Dolce Vita time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Turbulent times are coming, s 阅读全文
posted @ 2023-06-29 10:21 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑
摘要:Scoring Subsequences time limit per test 2.5 seconds memory limit per test 256 megabytes input standard input output standard output The score of a se 阅读全文
posted @ 2023-06-24 09:39 o-Sakurajimamai-o 阅读(25) 评论(0) 推荐(0) 编辑
摘要:用nsqrt(n)的时间复杂度就能过 //Dreaming of Freedom:https://codeforces.com/problemset/problem/1826/C #include <bits/stdc++.h> //#define int long long using names 阅读全文
posted @ 2023-06-23 10:25 o-Sakurajimamai-o 阅读(40) 评论(0) 推荐(0) 编辑
摘要:Getting Zero time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Suppose you have an integer 阅读全文
posted @ 2023-06-21 13:05 o-Sakurajimamai-o 阅读(12) 评论(0) 推荐(0) 编辑
摘要:思路:找规律情况一: 尾数为5或0 为5时进行一次操作变成0的情况。而尾数是 0 时操作无意义,所有数必须相等。情况二:尾数为 1,3,7,9可进行一次操作变成情况三。情况三:尾数为 2,4,6,8我们通过找规律发现: 2⇒4⇒8⇒16⇒22 4⇒8⇒16⇒22⇒24 6⇒12⇒14⇒18⇒26 8 阅读全文
posted @ 2023-06-20 11:47 o-Sakurajimamai-o 阅读(38) 评论(0) 推荐(0) 编辑
摘要:第一次参加codeforces比赛,只能做出来俩题,第三个题思路也就一半一半,估计是想不出来的那种,赛后问了下带佬,把我思路添加了点,最终还是A了 争取稳过第三题! //A //统计1,-1出现的次数,然后如果-1是奇数,让他变成偶数,次数+1 //因为总乘积要是正1,然后再变-1为1,直到>=0为 阅读全文
posted @ 2023-06-19 09:24 o-Sakurajimamai-o 阅读(6) 评论(0) 推荐(0) 编辑
摘要:【题面】 你决定用素数定理来做一个调查. 众所周知, 素数又被称为质数,其含义就是除了数字一和本身之外不能被其他任何的数字除尽. 现在给定一个正整数序列 ,+1,⋯ ,a,a+1,⋯,b (≤)(a≤b), 请找出一个最小值 l, 使其满足对于任意一个长度为 l 的子串, 都包含 k 个质数. 找到 阅读全文
posted @ 2023-06-18 10:17 o-Sakurajimamai-o 阅读(19) 评论(0) 推荐(0) 编辑
摘要:最近碰到的二分题有点多,而且方法都不同,拿来说一下,顺便给自己做下总结 模板1: while (l < r) { int mid = l + r >> 1; //(l+r)/2 if (check(mid)) r = mid; // check()判断mid是否满足性质 else l = mid + 阅读全文
posted @ 2023-06-17 13:59 o-Sakurajimamai-o 阅读(59) 评论(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 阅读(13) 评论(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 阅读(11) 评论(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 阅读(23) 评论(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 阅读(19) 评论(0) 推荐(0) 编辑
摘要:C. Helping the Nature time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Leon lives 阅读全文
posted @ 2023-06-14 14:59 o-Sakurajimamai-o 阅读(13) 评论(0) 推荐(0) 编辑
摘要:给出一个长为n的只由'1','2','0'组成的字符串,要求改动最少的位置,使'1','2','0'的个数相同(保证n能被3整除),并使改动后的字符串字典序最小。 n不大于3∗105 贪心思路,从左向右大的变小的,从右向左小的变大的: #include<bits/stdc++.h> using na 阅读全文
posted @ 2023-06-13 11:38 o-Sakurajimamai-o 阅读(6) 评论(0) 推荐(0) 编辑
摘要:非常蛋疼的题,做了俩小时,看题解用了一个半小时 给你两个字符串 s1、s2,问至少要多少个s1首尾相接能变成s2 s1拼接之后可以删除一些子串 输入输出样例 输入 #1复制 abc xyz 输出 #1复制 -1 输入 #2复制 abcd dabc 输出 #2复制 2 #include<bits/st 阅读全文
posted @ 2023-06-12 20:38 o-Sakurajimamai-o 阅读(12) 评论(0) 推荐(0) 编辑
摘要:B. Pasha Maximizes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Pasha has a positive i 阅读全文
posted @ 2023-06-12 13:53 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑

-- --