JAN

洛谷 P9020 - [USACO23JAN] Mana Collection P

显然,每个法力池最终能收集到的法力只与这个法力池最终被收集到的时间有关。 对于一组询问 $(s,e)$,假设我们经过了 $k$ 个法力池,我们钦定最终被收集到的时间从后到前分别是 $e=a_1,a_2,\cdots,a_k$,那么最大法力值为 $\sum\limits_{i=1}^kc_{a_i}· ......
Collection P9020 USACO 9020 Mana

题解 [USACO18JAN] MooTube G

[题目链接](https://www.luogu.com.cn/problem/P4185) 可以发现,对于一个固定的 $k$,所有边权小于 $k$ 的边对答案是没有贡献的,因为一条边的相关性是最小相关性,这也意味着我们不能从 $ using namespace std; #define PII p ......
题解 MooTube USACO JAN 18

题解 P4183 [USACO18JAN] Cow at Large P

带有小 trick 的点分治。 建议先做完 [弱化版](https://www.luogu.com.cn/problem/P4186) 再看。 假如奶牛在 $u$,那么所需的最少农夫数为 $\sum\limits_{v\in son(u)}[dis(u,v)\ge g_v][dis(u,fa_v) ......
题解 P4183 Large USACO 4183

python包报错ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'OpenSSL 1.0.2k-fips 26 Jan 2017'

报错:ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the ‘ssl’ module is compiled with OpenSSL 1.1.0h 27 Mar 2018. 解决办法:Terminal窗口执行:p ......
OpenSSL 39 ImportError currently compiled

P8095 [USACO22JAN] Cereal 2 S 谷物早餐

# P8095 [USACO22JAN] Cereal 2 S 谷物早餐 [P8095 [USACO22JAN\] Cereal 2 S - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)](https://www.luogu.com.cn/problem/P8095) [TOC] # ......
谷物 早餐 Cereal P8095 USACO

P3134 [USACO16JAN] Lights Out G 关灯

# P3134 [USACO16JAN] Lights Out G 关灯 [TOC] [题目传送门洛谷链接](https://www.luogu.com.cn/problem/P3134) # [USACO16JAN] Lights Out G ## 题面翻译 ### 题目描述 Farmer Joh ......
Lights P3134 USACO 3134 JAN

P3133 [USACO16JAN] Radio Contact G 无线电通话

# P3133 [USACO16JAN] Radio Contact G 无线电通话 [TOC] [题目传送门](https://www.luogu.com.cn/problem/P3133) ## [USACO16JAN] Radio Contact G ### 题目描述 Farmer John ......
无线电 Contact 无线 P3133 USACO

NC24048 [USACO 2017 Jan P]Promotion Counting

[题目链接](https://ac.nowcoder.com/acm/problem/24048) # 题目 **题目描述** The cows have once again tried to form a startup company, failing to remember from pas ......
Promotion Counting 24048 USACO 2017

P2860 [USACO06JAN]Redundant Paths G 题解 ratjan边双连通分量

题目链接:[https://www.luogu.com.cn/problem/P2860](https://www.luogu.com.cn/problem/P2860) 题目大意: 给定一个无向连通图,求至少加几条边,能使其变成一个边双连通图。 解题思路: 边双连通分量缩点后计算度数为 $1$ 的 ......
题解 分量 Redundant ratjan P2860

Luogu P3605 [USACO17JAN]Promotion Counting P

# [USACO17JAN]Promotion Counting P ## 题目描述 The cows have once again tried to form a startup company, failing to remember from past experience that cow ......
Promotion Counting Luogu P3605 USACO

[USACO07JAN] Balanced Lineup G(树状数组)

### 题目大意: 给出长度为n的数组和q个询问,每次问(x,y)区间内最大值和最小值的差是多少 ### 思路: 1.适合用树状数组做此区间求值,首先要明白普通的树状数组的tree[x]表示区间(x-(x&-x),x]的区间和,现在改为求最值,则tree[x]表示为区间(x-(x&-x),x]的最值 ......
数组 Balanced Lineup USACO JAN

[USACO08JAN]Cell Phone Network G

### 题意: 给出由n个点和(n-1)条边构成的树,每个点可以覆盖每个相邻点,求把树上所有点覆盖完成至少需要挑出多少点来做覆盖操作 ### 思路: 先明确用树形dp来做解答,用dp[i][]来表示覆盖对应点和其下方所有节点的最小花费 对于要覆盖的每个点,我们可以有三种选择: 1.自己覆盖自己:这时 ......
Network USACO Phone Cell JAN

Jan 2023-Prioritizing Samples in Reinforcement Learning with Reducible Loss

#1 Introduction 本文建议根据样本的可学习性进行抽样,而不是从经验回放中随机抽样。如果有可能减少代理对该样本的损失,则认为该样本是可学习的。我们将可以减少样本损失的数量称为其可减少损失(ReLo)。这与Schaul等人[2016]的vanilla优先级不同,后者只是对具有高损失的样本给 ......

「USACO2016JAN」Subsequences Summing to Sevens

[USACO16JAN]Subsequences Summing to Sevens S 题目描述 Farmer John's $N$ cows are standing in a row, as they have a tendency to do from time to time. Each ......
Subsequences Summing Sevens USACO 2016

# P4183 [USACO18JAN]Cow at Large P 题解

# P4183 [USACO18JAN]Cow at Large P ## 题意 贝茜被农民们逼进了一个偏僻的农场。农场可视为一棵有 $N$ 个结点的树,结点分别编号为 $1,2,\ldots, N$ 。每个叶子结点都是出入口。开始时,每个出入口都可以放一个农民(也可以不放)。每个时刻,贝茜和农民都 ......
题解 P4183 Large USACO 4183

P6007 [USACO20JAN]Springboards G

$\color{purple}\text{P6007 [USACO20JAN]Springboards G}$ 题意 你从 $(0,0)$ 出发,到达 $(n,n)$ ,每次只能向上或向右走,有 $m$ 个传送门,将你传送到传送门起点右上方的一个终点。求最少走路次数。 解法 我们不走传送门的时候答案 ......
Springboards P6007 USACO 6007 JAN

NC25045 [USACO 2007 Jan S]Balanced Lineup

题目链接 题目 题目描述 For the daily milking, Farmer John's N cows (1 ≤ N ≤ 100,000) always line up in the same order. One day Farmer John decides to organize a ......
Balanced Lineup 25045 USACO 2007

[USACO17JAN]Promotion Counting P 题解

[USACO17JAN]Promotion Counting P 题解 题目描述 给你一棵树,每个点有一个点权 $p_i$,求 $\forall i$,$i$ 的子树内点权比 $i$ 的点权大的点的数量。 思路 看到子树我就忍不住了,不得不狠狠地吧树拍到 $dfn$ 序上了,发现用 $dfn$ 拍扁 ......
题解 Promotion Counting USACO JAN

P3008 [USACO11JAN]Roads and Planes G

P3008 [USACO11JAN]Roads and Planes G ##思路 按照分连通块的方法进行计算,并且如果不是本连通块的点,不能在现在的本次dfs中求解最小值。要一个一个的联通快进行标记。 /* 不能直接走disj的话,缩点的思想很重要 首先尽量不要使用spfa进行走图,可能会卡 对道 ......
Planes P3008 USACO Roads 3008

P9019 [USACO23JAN] Tractor Paths P

Problem Luogu P9019 [USACO23JAN] Tractor Paths P Solution 首先有一个显然的结论,区间 $i$ 向右能到的区间是 $[i+1,RT_i]$,向左能到的区间是 $[LT_i,i-1]$。 根据这个考虑倍增。定义跳一步表示从当前区间去到最远能去的区 ......
Tractor P9019 USACO Paths 9019
共50篇  :2/2页 首页上一页2下一页尾页