problem maximum 1832b sum

CF1201C - Maximum Median

思路 二分答案。对于一个mid,查询中位数要是为mid的话至少要做多少次操作,最小操作次数就是排序后从中位数开始计算max(0, mid - v[i])的和 ac代码 #include <bits/stdc++.h> using namespace std; using i64 = long lon ......
Maximum Median 1201C 1201 CF

AtCoder Beginner Contest 335 G Discrete Logarithm Problems

洛谷传送门 AtCoder 传送门 考虑若我们对于每个 \(a_i\) 求出来了使得 \(g^{b_i} \equiv a_i \pmod P\) 的 \(b_i\)(其中 \(g\) 为 \(P\) 的原根),那么 \(a_i^k \equiv a_j \pmod P\) 等价于 \(kb_i \ ......
Logarithm Beginner Discrete Problems AtCoder

[Linux] 常用命令之【md5sum(MD5校验)】

0 序 本文主要参考自: Linux命令之MD5校验md5sum 1 命令概述 1.1 用途 md5sum : 用于计算和校验文件的MD5值。 $ echo "hello world" | md5sum.ex 6f5902ac237024bdd0c176cb93063dc4 *- md5sum 常常 ......
命令 常用 md5sum Linux 5sum

CF1006E Military Problem 题解

CF1006E Military Problem 题解 题意 给定一颗有 \(n \thinspace (2 \leq n \leq 2 \times 10^5)\) 个节点的树,树根为 \(1\)。 对于每个节点 \(i \thinspace (2 \leq i \leq n)\) 都有它的父节点 ......
题解 Military Problem 1006E 1006

并行 sha256sum 命令

之前为文件夹里的文件生成 SHA-256 摘要时,我使用的是 sha256sum *.mp4 *.xml *.jpg > sha256sums.txt 这个命令是逐个生成哈希值的,在计算完成 1.mp4 之前并不会开始计算 2.mp4,不能很好得利用多核性能。 解决办法也很简单,利用“百闻不如一见” ......
命令 sha 256 sum

P4137 Rmq Problem / mex

题意 给定一个长度为 \(n\) 的数组。 \(q\) 次询问,每次询问区间 \(mex\)。 Sol 考虑主席树维护区间 \(mex\)。 不难发现可以考虑维护当前所有点的最后出现的下标。 直接套板子即可。 Code #include <iostream> #include <algorithm> ......
Problem P4137 4137 Rmq mex

gurobipy: Gurobi Optimizer is a mathematical optimization software library for solving mixed-integer linear and quadratic optimization problems

Project description The Gurobi Optimizer is a mathematical optimization software library for solving mixed-integer linear and quadratic optimization p ......

CF Beta Round 93-D.Fibonacci Sums-齐肯多夫分解、DP

CF Beta Round 93-D.Fibonacci Sums-齐肯多夫分解、DP https://codeforces.com/contest/126/problem/D 定义Fibonacci序列:\(F_1=1,F_2=2,F_k=F_{k-1}+F_{k-2}(\forall k\geq ......
Fibonacci Round Beta Sums CF

http://www.nfls.com.cn:20035/contest/1878/problem/5

http://www.nfls.com.cn:20035/submission/781868 #include<bits/stdc++.h> using namespace std; int N, ct[45], b[25], ans, a[45][5]; void dfs(int t, int s ......
contest problem 20035 http 1878

[转帖]ORA-01450 maximum key length (3215) exceeded

https://blog.csdn.net/Hehuyi_In/article/details/106579031 一、 问题背景 给一个业务表online建索引时遇到了ORA-01450 maximum key length (3215) exceeded报错,看字面意思是字段太长了,检查表字段类 ......
exceeded maximum length 01450 3215

Maximum Depth of Binary Tree

Source Problem Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the rootnode down to ......
Maximum Binary Depth Tree of

CF1917D Yet Another Inversions Problem 题解

官方题解。 思路 首先可以把 \(a\) 数组分成 \(n\) 块,每块都是长为 \(k\) 的 \(q\) 数组。于是我们可以把答案拆成两部分计算:块内的贡献和块外的贡献。对于块内,\(p_i\) 都是一样的,因此可以直接消去,计算的实际上就是 \(q\) 序列的逆序对数,把这个值 \(\time ......
题解 Inversions Another Problem 1917D

The Biggest Water Problem

地址 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll n; cin>>n; ll sum=0; while(n>10){ ll sum=n; ll d=0; while(sum){ ......
Biggest Problem Water The

CF1270G Subset with Zero Sum

G. Subset with Zero Sum 很妙。 一开始冲着背包去想的,显然不行。 考虑他条件给的这个 \(i − n \le a_i \le i − 1\) 化简一下得到 \[1 \le i - a_i \le n \]题目要去求 \[\sum \limits_{i \in S} a_i = ......
Subset 1270G 1270 with Zero

[ARC150F] Constant Sum Subsequence

更好的阅读体验 [ARC150F] Constant Sum Subsequence 很有意思的题。 设 \(nex_{i,j}\) 表示位置 \(i\) 后面的最小的满足 \(k>i\wedge a_k=j\) 的 \(k\),则问题可以抽象为: \[f_i=\max_{j=1}^inex_{f_ ......
Subsequence Constant 150F ARC 150

CF1270G Subset with Zero Sum

题目链接:洛谷 或者 CF 比较朴素的题,首先观察题目条件: \[ i-n \le a_i \le i-1 \Rightarrow 1 \le i-a_i \le n \text{,所以易知 } i-a_i \text{ 必定是某一点} \]考虑构造题目所说 \[\sum_{i=x_1}^{x_{t ......
Subset 1270G 1270 with Zero

curl_easy_perform() failed: Problem with the SSL CA cert (path? access rights?)

curl_easy_perform() failed: Problem with the SSL CA cert (path? access rights?) 最近遇到了一个这个问题 发现是因为自己加了一个这个 curl_easy_setopt(pCURL, CURLOPT_SSL_OPTIONS, ......

FreeBSD “su: Sorry” Problem

Solving the FreeBSD “su: Sorry” Problem The solution is to restart FreeBSD in single user mode and then make the change as root. This can be done by f ......
FreeBSD Problem Sorry su

超微X12主板通过sum升级出现OEM参数支持的问题

出现以下情况,请更新你的sum工具,超微X11主板和X12主板OEM定制参数发生了改变,所以出现了不支持的OEM参数 ......
主板 参数 问题 X12 OEM

洛谷 P9061 [Ynoi2002] Optimal Ordered Problem Solver

洛谷传送门 QOJ 传送门 考虑操作了若干次,所有点一定分布在一个自左上到右下的阶梯上或者在这个阶梯的右(上)侧。此处借用 H_W_Y 的一张图: 考虑如何计算答案。对于一次询问 \((X, Y)\),如果它在阶梯左下方不用管它,否则考虑容斥,答案即为 \(x \ge X, y \ge Y\) 的点 ......
Optimal Ordered Problem Solver P9061

CF1910I Inverse Problems

题目链接:https://codeforces.com/contest/1910/problem/I 题意 有一个 \(n\) 个字符的字符串 \(S\),你需要不断从中删除一个长度为 \(k\) 的子串,直到串的长度变为 \(n \mathbin{\rm mod} k\),求能够产生的字典序最小的 ......
Problems Inverse 1910I 1910 CF

Codeforces 1909I - Short Permutation Problem

介绍一下 k 老师教我的容斥做法。 考虑固定 \(m\) 对所有 \(k\) 求答案。先考虑 \(k=n-1\) 怎么做。我们将所有元素按照 \(\min(i,m-i)\) 为第一关键字,\(-i\) 为第二关键字从小到大插入,即按照 \(n,n-1,n-2,\cdots,m+1,m,1,m-1,2 ......
Permutation Codeforces Problem 1909I Short

CF1442D Sum

题意 给定 \(n\) 个递增数组。 \(k\) 次操作,每次你可以选择一个数组,使 \(ans\) 加上数组的第一个数,并删除。 问最大化的 \(ans\) 的值。 Sol 考虑当前选择的方案如何变得更优。 不难想到,如果当前有两个数组没有选满,则一定可以调整到其中一个变成空的方案,而使得答案不劣 ......
1442D 1442 Sum CF

D. Mathematical Problem

原题链接 题解链接 code #include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; if(n==1) { puts("1"); continue; } ......
Mathematical Problem

Problem I Like

\(\LARGE{\frac{\frac{\int_{0}^{+\infty}e^{-s}s^5ds }{2} +\frac{\int_{0}^{+\infty}e^{-\frac{t^2}{2}}dt}{\int_{0}^{+\infty}\sin t^2dt} (\frac{\sum_{n=0} ......
Problem Like

P10033 「Cfz Round 3」Sum of Permutation

原题链接 基础赛唯一写了的题,因为我喜欢构造! 事实上的确有点麻烦了,应该会有更好的做法。但是自我感觉这个思维很连贯,因为这就是我做题时思路的写照。 记 \(p_{pos1}=1,p_{posn}=n\)。 首先可以构造 \(a_i\gets p_i+1\) 这样一定满足第二个限制,但是当 \(p_ ......
Permutation P10033 10033 Round Cfz

CF1916D Mathematical Problem

思路 很不错的人类智慧题。 拿到以后,完全没有思路,看到数据范围,感觉是什么 \(n^2\log n\) 的逆天做法,但是又完全没思路,看后面的题感觉没希望,就在这道题死磕。 先打了个暴力程序,发现平方数太多,没什么规律,就拿了个 map 统计一下那些出现数字方案拥有的平方数比较多 程序如下: #i ......
Mathematical Problem 1916D 1916 CF

Maximum And Queries (hard version)

题目传送门 感觉这题比 \(\rm F\) 难啊,\(\rm F\) 就是个板子,但为啥这题是蓝的,\(\rm F\) 是紫的。 思路 首先考虑 \(nq\) 怎么做。 发现很简单,按位贪心就行了。 具体地说,从大到小枚举二进制位,判断答案中能否出现这一位,若 \(i\) 当前这一位没有值,那么必须 ......
Maximum Queries version hard And

ICPC2021Kunming G Find the Maximum 题解

Question Find the Maximum 给出一个树,每个点有一个权值 \(b_n\),求一条树上路径 \(V\),要求 \(\frac{\sum_{u\in V (-x^2+b_u x)}}{|V|}\) 最大,其中 \(x\) 是自己选择的一个树 Solution 先转化一下 \(\f ......
题解 Kunming Maximum ICPC 2021

D. Yet Another Inversions Problem

D. Yet Another Inversions Problem You are given a permutation $p_0, p_1, \ldots, p_{n-1}$ of odd integers from $1$ to $2n-1$ and a permutation $q_0, q ......
Inversions Another Problem Yet
共620篇  :1/21页 首页上一页1下一页尾页