相关文章
LeetCode 626.换座位
数据准备
Create table If Not Exists Seat (id int, student varchar(255));
Truncate table Seat;
insert into Seat (id, student) values (1, Abbot);
insert into Seat (id, student) values (2, Doris);
insert into Seat (id, student) values (3, Emerson);
insert in…
建站知识
2025/2/9 15:20:47
codeforce626 E. Simple Skewness 二分
codeforce626 E. Simple Skewness
均值-中位数 最大的子集
枚举中值,二分区间大小
要使 均值-中位数 最大,所以最大化均值,即从最后取最大的L个数,从中位数前取相邻的L个数
若区间扩大均值扩大则扩大,否则缩小
#i…
建站知识
2025/1/21 12:11:53
Codeforces 626A Robot Sequence
题目:http://codeforces.com/problemset/problem/626/A
代码: #include<stdio.h>
#include<string.h>
#include<string>using namespace std;int main()
{int a;while(~scanf("%d",&a)){char b[205];scanf("%s&qu…
建站知识
2025/2/22 21:04:21
LeetCode 626. Exchange Seats
背景:seat表(id, student),其中id是递增的,交换相邻位置,如果是奇数个,最后一个不处理
思路:交换id
sql语句如下:
select (case when mod(id, 2) ! 0 and cnt ! id then id 1when mod(id, 2…
建站知识
2025/3/19 11:27:07
codeforces 626C 二分判定
点击打开链接 #include <iostream>
#include <cstring>
using namespace std;
typedef long long ll;
int n,m;
const long long inf6e6;
bool check(ll x)
{//最大数x之前 至少有n个2的倍数,m个3的倍数if(x/2<n||x/3<m||(x/2x/3-x/6)<nm)//2 3倍数集合中…
建站知识
2025/2/18 5:55:29
SWUST626 分数分解
SWUST626 分数分解
Position:
* http://acm.swust.edu.cn/problem/0626/* List SWUST626 分数分解 ListDescriptionInputOutputSample InputSample OutputSolutionCode变式 Description 分子为1 的分数称为埃及分数,现输入一个真分数,请将…
建站知识
2025/2/3 14:24:59
Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)C. Unusual Competitions
C. Unusual Competitions time limit per test1 second memory limit per test512 megabytes inputstandard input outputstandard output A bracketed sequence is called correct (regular) if by inserting “” and “1” you can get a well-formed mathematical expressi…
建站知识
2025/3/6 12:07:42
[DP] Codeforces #626F. Group Projects
显然是 DP 。这种贡献和最值有关的,一般用按顺序插入的方法 DP ,会简单很多。有挺多类似的题的。 这题就是 fi,j,k 表示插入了前 i 个,有 j 个块开发待插入,总代价为 k 。
每次插入 i+1 就考虑是新开一个块还是插入原有块中ÿ…
建站知识
2025/2/18 11:32:43