随笔分类 -  Codeforces

摘要:本章节部分参考:2020,2021 年 CF 简单题精选 - 题单 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) T1:Problem - B - Codeforces 首先,很容易观察到点的一些特征: - 都在第一象限;- 点的分布越来越稀疏。 以样例为例: 还有无限个点没有画 阅读全文 »
posted @ 2024-01-29 20:18 o-Sakurajimamai-o 阅读(769) 评论(0) 推荐(1) 编辑
摘要:A - Subtle Substring Subtraction /* * __ ~~~~~~~~~~~ ___ * . . ~~// ...... __--~ ~~ * -. \_|// |||\ ~~~~~~::::... /~ * ___ _ _-~o~ \/ ||| \ _/~~- * 阅读全文 »
posted @ 2023-11-20 16:12 o-Sakurajimamai-o 阅读(7) 评论(0) 推荐(0) 编辑
摘要://http://codeforces.com/problemset/problem/1690/E //利用set数组 里面储存的是 每一个数字%k之后的数字,由于特殊性,一个数大于k,那么就算这个数+0他对答案的贡献最少也是 m/k的价值 //所以可以直接计算价值,然后第二位储存编号,便于分辨 / 阅读全文 »
posted @ 2023-10-13 13:43 o-Sakurajimamai-o 阅读(8) 评论(0) 推荐(0) 编辑
摘要://A #include <bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10,mod=1e9+7; string s; int n,t,a[N],f[N],res,num,ans,m,k,p; b 阅读全文 »
posted @ 2023-08-06 16:08 o-Sakurajimamai-o 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> #define int long long using namespace std; const int N=1e6+10,mod=1e9+7; string s; int n,t,a[N],f[N],res,num,ans,m; bool vis[ 阅读全文 »
posted @ 2023-07-30 01:49 o-Sakurajimamai-o 阅读(16) 评论(0) 推荐(0) 编辑
摘要:Tracking Segments You are given an array a consisting of n zeros. You are also given a set of m not necessarily different segments. Each s 阅读全文 »
posted @ 2023-07-27 11:19 o-Sakurajimamai-o 阅读(24) 评论(0) 推荐(0) 编辑
摘要:# Diverse Substrings ## 题面翻译 定义一个数字串是**多变的**当且仅当其中所有数字的重复次数均不超过其中不同数字的种类数。 给定一个由 09 组成的长为 n 的数字串 s,求其不同的**多变的**子串 s[l,r] 的个数。 ## 题目描述 阅读全文 »
posted @ 2023-07-24 11:20 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑
摘要:Ice and Fire time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little09 and his friends are 阅读全文 »
posted @ 2023-07-22 10:26 o-Sakurajimamai-o 阅读(10) 评论(0) 推荐(0) 编辑
摘要:# Subsequence Addition (Hard Version) ## 题面翻译 本题为困难版,两题的唯一区别在于数据范围的大小。 数列 a 最开始只有一个数 1,你可以进行若干次操作,每次操作你可以选取 k 个数(k 无限制,小于等于 a 的大小即可),将这 k 阅读全文 »
posted @ 2023-07-22 10:25 o-Sakurajimamai-o 阅读(22) 评论(0) 推荐(0) 编辑
摘要://A //如果两者的距离是奇数的话,那就追不上,如果是偶数,那就追的上 //因为偶数是与小明同类型的位置,只需要把小明逼到墙角就可以了 //可以画一个九宫格,然后把9x9的格子分两种颜色染上,一开始在相同颜色的格子一定会相遇 #include <bits/stdc++.h> #define int 阅读全文 »
posted @ 2023-07-20 10:11 o-Sakurajimamai-o 阅读(13) 评论(0) 推荐(0) 编辑
摘要:# Hamiltonian Wall ## 题面翻译 给你一个 2×m 的矩阵,矩阵中只可能包含字符 `B` 和 `W`。每一列都有字符 `B`。问能否找出一条路径,满足: - 路径中相邻两格有公共边(只有公共点的不算)。- 每个 `B` 格恰好被覆盖一次。- 每个 `W` 格都没有 阅读全文 »
posted @ 2023-07-13 19:13 o-Sakurajimamai-o 阅读(26) 评论(0) 推荐(0) 编辑
摘要:# Notepad# ## 题面翻译 ### 题目描述 一开始打出的内容为空。现在你要打出一个长度为 n 的字符串 s(全为英文小写字母组成),为此每次你可以进行如下操作中的一种: - 在已打出内容的最后添加一个字符。- 复制已打出内容的一个连续的子串并加到内容的末尾。 问你能不能在严格小于 阅读全文 »
posted @ 2023-07-13 19:12 o-Sakurajimamai-o 阅读(32) 评论(0) 推荐(0) 编辑
摘要:Come Together time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bob and Carol hanged out w 阅读全文 »
posted @ 2023-07-12 15:50 o-Sakurajimamai-o 阅读(32) 评论(0) 推荐(0) 编辑
摘要:Strong Password time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Monocarp finally got the 阅读全文 »
posted @ 2023-07-12 15:46 o-Sakurajimamai-o 阅读(63) 评论(0) 推荐(0) 编辑
摘要:Apple Tree time limit per test 4 seconds memory limit per test 512 megabytes input standard input output standard output Timofey has an apple tree gro 阅读全文 »
posted @ 2023-07-11 15:40 o-Sakurajimamai-o 阅读(43) 评论(0) 推荐(0) 编辑
摘要:Sum in Binary Tree time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vanya really likes mat 阅读全文 »
posted @ 2023-07-11 15:39 o-Sakurajimamai-o 阅读(58) 评论(0) 推荐(0) 编辑
摘要:Long Long 题面翻译 题目描述给出一个包含 n 个数字的数列 a。你可以执行任意次操作,每次操作可以更改 [l, r] 范围内的正负性(正数变负,负数变正,0 不变)。你要使得数列每个元素之和尽量大,问最小的操作次数。 多组询问。 输入格式第一行一个整数 T,表示询问组数。 每一 阅读全文 »
posted @ 2023-07-11 15:36 o-Sakurajimamai-o 阅读(33) 评论(0) 推荐(0) 编辑
摘要:Lamps 题面翻译 有 n 盏灯,每盏灯有不亮,亮,坏掉 3 种状态。一开始每盏灯都不亮。 第 i 盏灯有属性 ai,bi。每次操作你可以选择一盏灭的灯将其点亮,并得到 bi 的分数。 每次操作结束后,记有 x 盏灯亮着,则所有 aix 的灯 i 都会 阅读全文 »
posted @ 2023-07-10 18:23 o-Sakurajimamai-o 阅读(85) 评论(0) 推荐(0) 编辑
摘要:# Contrast Value ## 题面翻译 定义序列 a1,a2,,an 的权值是|a1a2|+|a2a3|++|an1an|T 次询问,每次给一个序列 a ,一个 a 的子序列 b 合法当且仅当 b 权值和 $ 阅读全文 »
posted @ 2023-07-10 18:16 o-Sakurajimamai-o 阅读(19) 评论(0) 推荐(0) 编辑
摘要:Maximum Sum time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given an array a1,a2 阅读全文 »
posted @ 2023-07-10 18:15 o-Sakurajimamai-o 阅读(21) 评论(0) 推荐(0) 编辑

-- --
点击右上角即可分享
微信分享提示