optimization university stanford convex

[894] Optimize arcpy scripts

ref: Parallel Processing Factor (Environment setting) ref: Write geoprocessing output to memory Parallel processing arcpy.env.parallelProcessingFactor ......
Optimize scripts arcpy 894

The 2nd Universal Cup. Stage 4: Taipei - I(状压DP)

目录I. Interval Addition I. Interval Addition 题意 给定一个长度为 n $(1\le n \le 23) $ 的数组 a。你可以进行一种操作:选择区间 \([l, r]\) 并给这个区间所有的数都加上一个任意的数。问你使得整个数组均为 0 所需的最小操作次数 ......
Universal Taipei Stage The 2nd

The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online (The 2nd Universal Cup

The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online (The 2nd Universal Cup. Stage 1: Qingdao) J - Press the Button \(1 \leq a, b, c, d \leq 10^6\) ......
The Universal ACM-ICPC Regional Contest

The 2023 CCPC Online Contest (The 2nd Universal Cup, Stage 3: Binjiang)

题解: https://files.cnblogs.com/files/clrs97/CCPC-Online-2023-%E9%A2%98%E8%A7%A3.pdf Code: A. Almost Prefix Concatenation #include<cstdio> #include<cstr ......
The Universal Binjiang Contest Online

The 2023 ICPC Asia Hong Kong Regional Programming Contest (The 1st Universal Cup, Stage 2:Hong Kong)

题解: https://files.cnblogs.com/files/clrs97/2022Hong_Kong_Tutorial.pdf Code: A. TreeScript #include <bits/stdc++.h> using namespace std; using LL = lon ......
Hong Kong Programming The Universal

Madoka and The Best University (cf E)( 枚举一个其中一个元素,欧拉函数,gcd)

#include<iostream> #include<cstring> using namespace std; const int Maxn=1e7; int phi[Maxn];//记录数的约数个数(欧拉函数) bool vis[Maxn];//记录数字是否访问 int prime[Maxn] ......
University 函数 元素 Madoka Best

AGC049D Convex Sequence 题解

题意 若非负数列 \(A\) 中任意 \(i(2 \leq i \leq N-1)\) ,都有 \(2A_i \leq A_{i-1} + A_{i+1}\),则称 \(A\) 为凸数列。 问长为 \(N\) ,且数列中所有项的和为 \(M\) 的凸数列有多少个,答案对 \(10^9+7\) 取模。 ......
题解 Sequence Convex 049D AGC

Gym 104270 The 2018 ICPC Asia Qingdao Regional Programming Contest (The 1st Universal Cup, Stage 9: Qingdao)

A. Sequence and Sequence B. Kawa Exam 可以发现,对答案会产生影响的只有割边,把所有边双缩起来,然后就是一个森林。 考虑一个树的时候怎么做,就是对于每条边求出这条边两端的众数个数,考虑线段树合并,每次动态维护子树内的众数和子树外的众数。 #include<iost ......
Qingdao Programming The Universal Regional

qoj6735. Tree (The 1st Universal Cup. Stage 22: Shaanxi)

https://qoj.ac/contest/1287/problem/6735 考虑定一个根,然后把每个点的点权附属在父边权上,让每条边的边权变成一个 pair。 这样,一个符合条件的路径需要满足的条件是:路径内所有边的边权 pair 相同,以及 路径根节点(lca)的颜色符合。 对于当前树上每个 ......
Universal Shaanxi Stage 6735 Tree

Gym 104172 The 2023 ICPC Asia Hong Kong Regional Programming Contest (The 1st Universal Cup, Stage 2Hong Kong)

A. TreeScript 令 \(f_u\) 表示 \(u\) 及 \(u\) 子树中的节点都创建的最小数量。 如果 \(u\) 只有一个儿子,那么可以将子树最后一个节点存储在当前的 \(u\) 中,答案就是 \(f_v\)。 若 \(u\) 有多个儿子: 令 \(t=\max\limits_{v ......
Hong Kong Programming The Universal

AGC049D Convex Sequence 题解

题意 若非负数列 \(A\) 中任意 \(i(2 \leq i \leq N-1)\) ,都有 \(2A_i \leq A_{i-1} + A_{i+1}\),则称 \(A\) 为凸数列。 问长为 \(N\) ,且数列中所有项的和为 \(M\) 的凸数列有多少个,答案对 \(10^9+7\) 取模。 ......
题解 Sequence Convex 049D AGC

「解题报告」The 1st Universal Cup. Stage 3: Poland

大概按难度排序。签到题没写。 QOJ M. Minor Evil 有 \(n\) 个球与 \(k\) 个操作,初始所有球都是白色的。第 \(i\) 个操作为如果 \(a_i\) 是白色的,那么就将 \(b_i\) 染成黑色,否则什么都不做。你可以选择每个操作执行或不执行,但是不能改变操作之间的相对顺 ......
Universal 报告 Poland Stage The

The 2nd Universal Cup. Stage 2- SPb

A. Mixed Messages dp[i][j]表示前i位,选择\(j\)个移动到一起的最小花费。 #include<bits/stdc++.h> using namespace std; #define int long long constexpr int inf = 1E9; int32_ ......
Universal Stage The 2nd Cup

C#开源、功能强大、免费的Windows系统优化工具 - Optimizer

前言 今天给大家推荐一款由C#开源、功能强大、免费的Windows系统优化工具 - Optimizer。 工具介绍 Optimizer是一款功能强大的Windows系统优化工具,可帮助用户提高计算机性能、加强隐私和安全保护。该工具支持22种语言,同时提供了许多实用的功能,如关闭不必要的Windows ......
功能强大 Optimizer Windows 功能 工具

Docker - Optimized Dockerfile

We have the incentive to optimize our Dockerfile to build smaller images. Some of the points that we can probably come up with would be the following: ......
Dockerfile Optimized Docker

$2023 Xian Jiaotong University Programming Contest$

\(A.大水题\) void solve(){ int n=read(); puts(n<=6?"water":"dry"); //puts(ans>0?"Yes":"No"); } \(B.原粥率\) void solve(){ int n=read(),m=read(); double ans= ......
Programming University Jiaotong Contest 2023

粒子群算法(Particle Swarm Optimization, PSO)

Particle Swarm Optimization 算法原理参考: https://zhuanlan.zhihu.com/p/404198434 Question 使用PSO算法计算函数$ f(x) = x_1^2 + 3 x_2^2 - x_1 + 2 x_2 - 5 $ 在 \(x \in ......
粒子 Optimization 算法 Particle Swarm

Worst-Case Optimal Joins

Worst-Case Optimal Joins 当且仅当连接算法的计算复杂度不高于AGM bound,该算法才是Worst-Case Optimal的。 而计算AGM bound,需要计算fractional edge cover,也就是最小边覆盖。它要求给每条边赋权,所有权重之和最小,并且每个顶 ......
Worst-Case Optimal Worst Joins Case

The 2nd Universal Cup. Stage 2: SPb

链接:https://contest.ucup.ac/contest/1356 A. Mixed Messages #include "bits/stdc++.h" using namespace std; using i64 = long long; int main() { ios::sync_ ......
Universal Stage The 2nd Cup

Proj. CRR Paper Reading: Optimal Speedup of Las Vegas Algorithms, Adaptive restart for stochastic synthesis

Title Adaptive restart for stochastic synthesis PLDI 2021 Task Distribute the power between multiple runs in stochastic program synthesis to accelerat ......

Codeforces Global Round 21 B. NIT Destroys the Universe

给一个长为 \(n\) 的数组,可以执行以下操作任意次: 选择 \(l, r(1 \leq l < r \leq n)\) ,让 \(\forall i(l \leq i \leq r), a_i = mex(\{a_l, a_{l+1}, \cdots, a_{r}\})\) 。 问最小操作数使得 ......
Codeforces Destroys Universe Global Round

Common optimize technique

# Vectorization(矢量化) Before we understand the vectorization, we can see a common secnario. We have a array that has 100 float numbers, we want to calc ......
technique optimize Common

The 2nd Universal Cup. Stage 1- Qingdao

# A. Live Love 最大值就是把所有的$P$放在一起,最小值是尽可能的均分. ```cpp #include using namespace std; #define int long long void solve() { int n , m , d ; cin >> n >> m , ......
Universal Qingdao Stage The 2nd

MySQL的Equality Range Optimization of Many-Valued Comparisons

最近新上线的系统中遇到一个SQL,明明可以使用索引,但是发现实际执行并没有使用到索引。SQL的主要特点是where子句中,in判断中有大量的条件。类似如下: select * FROM a WHERE td in ('2023-08-01') and fuid in ('2','3','41','4 ......

The 2nd Universal Cup. Stage 1: Qingdao

### G #### Description 给定一个数列,每次ban一个位置,在每次ban之前,求连续子序列逆序对数的最大值,强制在线。(6s)$n\leq10^5, \sum n \leq10^6$ #### Solution 先考虑用权值线段树来维护区间逆序对数,不难支持在原数列前后加或删除一 ......
Universal Qingdao Stage The 2nd

Compiler optimization

1. 化简 - 代数化简 - 常量折叠 2. 内联 - 内部函数和外部函数 3. 指针 - 指针别名 - 合并写入 - 不能跳跃 4. 矢量化 - 使用更宽的寄存器xmm和ymm - 自动调用标准库 - 使用SIMD汇编指令(特殊情况使用边界特判) 5. 循环 6. 结构体 - 结构体内存布局 7. ......
optimization Compiler

This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.

This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.To enable the following instructions: AVX2 FM ......

强化学习 Proximal Policy Optimization (PPO)

参考: [李宏毅老师课件](https://speech.ee.ntu.edu.tw/~tlkagk/courses/MLDS_2018/Lecture/PPO%20(v3).pdf) PPO = Policy Gradient 从 On-policy 到 Off-policy, 再加一些const ......
Optimization Proximal Policy PPO

【笔记】凸优化 Convex Optimization

## Differentiation **Def. Gradient** $f:{\cal X}\sube\mathbb{R} ^N\to \mathbb{R}$ is *differentiable*. Then the *gradient* of $f$ at ${\bf x}\in\cal{X ......
Optimization 笔记 Convex