Loading

上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 84 下一页
摘要: A. 每组给一个和个数(),每次操作可以给一个加2,求是否能使n个数相等 4 3 1 1 3 4 1 1 2 1 2 11 11 1 100 YES NO YES YES 直接扫一遍,记录最大值与当前的差是否能被2整除。 #include<bits/stdc++.h> using namespace 阅读全文
posted @ 2020-07-14 21:05 RioTian 阅读(179) 评论(0) 推荐(1)
摘要: 解题思路 题目说的意思是,给一个2n个数的数组,注意n为奇数,将这个数组平均分为2份,假设为c1和c2。 c1和c2是奇数个元素的数组,比如数组[1,2,3],那么中位数就是2。 那么如何求得中位数差值最小的两个数组呢? 对于数组[1, 2, 3, 4, 5, 6],显然只要一个数组的中位数是3,另 阅读全文
posted @ 2020-07-14 20:02 RioTian 阅读(165) 评论(0) 推荐(1)
摘要: 51node 上的一道题目 01 串[1] 给定一个 01 串 S,求出它的一个尽可能长的子串 S[i..j],满足存在一个位置 i<=x <j, S[i..x]中 0 比 1 多,而 S[x + 1..j]中 1 比 0 多。求满足条件的最长子串长度。 输入 一行包含一个只由 0 和 1 构成的字 阅读全文
posted @ 2020-07-14 19:46 RioTian 阅读(622) 评论(0) 推荐(1)
摘要: 题意:不同奶茶店里同样的奶茶价格不同,问在当天Yuki持有的零钱能在几家店购买 思路:对价格数组排序,先优先判断是否会比较最大值和最小值,然后二分查找 #include<bits/stdc++.h> using namespace std; int main() { int n, q, m, a[1 阅读全文
posted @ 2020-07-14 19:14 RioTian 阅读(158) 评论(0) 推荐(0)
摘要: A Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper. Having learned the news, 阅读全文
posted @ 2020-06-30 21:22 RioTian 阅读(166) 评论(0) 推荐(0)
摘要: 记第一场CF赛,完成3道题 代码更新(降低时间复杂度和修改写法):21.1.23 A题 Required Remainder 题意:给你 x、y、n 求最大的k (k<=n) 使得k%x==y **做法:模拟 ** 寻找最大整除数,一开始while循环找,直接TLE2 #include<bits/s 阅读全文
posted @ 2020-06-29 20:32 RioTian 阅读(237) 评论(0) 推荐(1)
摘要: https://codeforces.com/contest/1360/problem/C We call two numbers xx and yy similar if they have the same parity (the same remainder when divided by 2 阅读全文
posted @ 2020-06-28 22:11 RioTian 阅读(428) 评论(0) 推荐(1)
摘要: 7 4 2 4 1 4 3 4 统计技能种类数量 4种不同技能 统计同一技能最大数量 技能1(数量1) 技能2(数量1) 技能3(数量1) 技能4(数量4) 选出 技能4(数量4) 作为 第2组 扣除技能4,还有4-1=3种不同技能 作为 第1组 发现,第2组数量4,第1组数量3 输出结果为3 5 阅读全文
posted @ 2020-06-28 21:39 RioTian 阅读(156) 评论(0) 推荐(1)
摘要: There is a game called "I Wanna Be the Guy", consisting of n levels. Little X and his friend Little Y are addicted to the game. Each of them wants to 阅读全文
posted @ 2020-06-27 21:32 RioTian 阅读(470) 评论(0) 推荐(1)
摘要: 正则表达式(Regular Expressions),又被称为regex、regexp 或 RE,是一种十分简便、灵活的文本处理工具。它可以用来精确地找出某文本中匹配某种指定规则的内容。从C++11开始也将正则表达式纳入了新标准的一部分 。 本篇博客不涉及正则表达式语法的基本内容,如果你对正则表达式 阅读全文
posted @ 2020-06-25 22:39 RioTian 阅读(979) 评论(0) 推荐(1)
摘要: Vasya works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to take a couple of ol 阅读全文
posted @ 2020-06-24 22:58 RioTian 阅读(194) 评论(0) 推荐(0)
摘要: 原题链接 KMP模板:AC,858ms,13112KB内存 消耗太大了 #include<bits/stdc++.h> using namespace std; using namespace std; #define ms(x, n) memset(x,n,sizeof(x)); typedef 阅读全文
posted @ 2020-06-23 20:38 RioTian 阅读(154) 评论(0) 推荐(0)
摘要: The end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye 阅读全文
posted @ 2020-06-23 20:24 RioTian 阅读(177) 评论(0) 推荐(0)
摘要: Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is posit 阅读全文
posted @ 2020-06-23 20:06 RioTian 阅读(460) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2020-06-22 18:20 RioTian 阅读(49) 评论(0) 推荐(1)
上一页 1 ··· 68 69 70 71 72 73 74 75 76 ··· 84 下一页