gallery graph 305e abc
[abc309 G] Ban Permutation
### [G - Ban Permutation](https://atcoder.jp/contests/abc309/tasks/abc309_g) 首先看到绝对值,很烦,考虑取掉绝对值得到$p_i\leq i-X$或$p_i\geq i+X$ 然后我们就自然而然有了一个暴力的想法,设$dp[i ......
[abc309 F] Box in Box
# [F - Box in Box](https://atcoder.jp/contests/abc309/tasks/abc309_f) 首先,每个长方体的$h,w,d$都是可以任意互换的,所以我们考虑用$a_0,a_1,a_2$来代替它们($a_0\leq a_1\leq a_2$) 然后可以发 ......
ABC310
[**A**](https://atcoder.jp/contests/abc310/tasks/abc310_a) ## 题意 给你$n,p,q$ 给你一个$n$长度的数组$D$ ,返回$\min(D_i+q,p)$ ~~~C++ #include using namespace std; typ ......
[ABC310E] NAND repeatedly 题解
怎么都是 dp 做的,就我是手玩出来的吗/oh。 首先关于 $\operatorname{NAND}$ 有一个经典技巧:$x\barwedge 0=1,x\barwedge 1=\neg x$。 发现一个 $0$ 会将值强制置 $1$,而一个 $1$ 会将值取反,于是 $f(l,r)$ 的值只取决于 ......
[ABC310F]Make 10 Again
[[ABC310F]Make 10 Again](https://atcoder.jp/contests/abc310/tasks/abc310_f) ## 题意 给定 $N$ 个骰子,每个骰子会随机的出现数字 $1$ 到 $A_i$ , 求能够从 $N$ 个骰子中选若干个, 使他们的点数之和为 $ ......
ABC243F
发现直接记录有哪些奖品被选是不可能的,所以考虑转换一下思路:设 $dp_{i,j,p}$ 为只考虑前 $i$ 个奖品,抽了 $j$ 次,有 $p$ 种不同奖品的的概率。 这个状态相当于是维护一个操作(抽奖)序列。考虑每次加入 $q$ 个第 $i$ 种奖品,就相当于是将原序列和一个由 $q$ 个 $i ......
abc089 <前缀和>
### 题目 [D - Practical Skill Test](https://atcoder.jp/contests/abc089/tasks/abc089_d) ### 思路 - 计算出所有结点在跳转过程中的前缀和, 从而O1查询 - 根据数据范围, 实际上不需要二分, 直接开相同大小的数组 ......
abc088 <bfs 最短路>
### 题目 [D - Grid Repainting](https://atcoder.jp/contests/abc088/tasks/abc088_d) ### 思路 - bfs找到从起点到终点的最短路, +1(起点), 即为至少留下的白色块的个数 - 则答案 = 总白色块数 - (最短路+1 ......
abc086d <二维前缀和 同余>
### 题目 [D - Checker](https://atcoder.jp/contests/abc086/tasks/arc089_b) ### 思路 - 坐标对 2k 取余, 通过二维前缀和计算满足条件的个数; - 也可对 k 取余, [参考](https://www.luogu.com.c ......
abc085d <贪心>
### 题目 [D - Katana Thrower](https://atcoder.jp/contests/abc085/tasks/abc085_d) ### 思路 - 关键: 连续使用ai与投掷bi并无冲突, 可先使用ai再投掷bi - 找到ai中的最大值maxa; 首先从大到小使用bi中比 ......
abc084d <素数筛 前缀和>
### 题目 [D - 2017-like Number](https://atcoder.jp/contests/abc084/tasks/abc084_d) ### 思路 - 筛出数据范围`1e5`范围内的素数 - 检查每个素数是否为 2017-like - 对`1~1e5`内的2017-lik ......
abc083d <思维 贪心>
### 题目 [D - Wide Flip](https://atcoder.jp/contests/abc083/tasks/arc088_b) ### 思路 参考[live4m的博客](https://blog.csdn.net/weixin_44178736/article/details/1 ......
abc082d <bitset 状压dp>
### 题目 [D - FT Robot](https://atcoder.jp/contests/abc082/tasks/arc087_b) ### 思路 - 动态规划的方式记录每次行动后, 机器人在坐标系中所有可能位置 - 通过bitset对状态进行压缩, 即每个位置有机器人true or 没 ......
[ABC135D] Digits Parade
> [Digits Parade の 传送门](https://www.luogu.com.cn/problem/AT_abc135_d) ## Solution 首先看到 > $1\le |S|\le 10^5$ 考虑 DP。 定义 $f_{i,j}$ 表示前 $i$ 个位置的数除以 $13$ 的 ......
Query2box Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
[TOC] > [Ren H., Hu W. and Leskovec J. Query2box: Reasoning over knowledge graphs in vector space using box embeddings. ICLR, 2020.](http://arxiv.org/ ......
ABC222D-Between Two Arrays(前缀和优化dp)
题意:给定两个递增数列A和B,构造一个ai <= ci <= bi 的递增数列C,询问满足条件的C的个数。 普通dp会超时,用前缀和优化 n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) ......
A Randomized Algorithm for Single-Source Shortest Path on Undirected Real-Weighted Graphs 部分翻译
A Randomized Algorithm for Single-Source Shortest Path on Undirected Real-Weighted Graphs Ran Duan , Jiayi Mao , Xinkai Shu , and Longhui Yin 这篇翻译必定有相 ......
[ABC134E] Sequence Decomposing
[Sequence Decomposing の 传送门](https://www.luogu.com.cn/problem/AT_abc134_e) ### 前置知识 > [multiset](https://zh.cppreference.com/w/cpp/container/multiset) ......
ABC309G Ban Permutation
### Problem > 求有多少个 $1$ 至 $n$ 的排列 $P$,满足对于任意 $i$ 都有 $|i-p_i|\ge X$。 > $1\le n\le 100$,$1\le X\le 5$。 ......
abc081d <思维 构造>
[D - Non-decreasing](https://atcoder.jp/contests/abc081/tasks/arc086_b) ``` // https://atcoder.jp/contests/abc081/tasks/arc086_b // // 两种情况非常容易构造 : 全整 ......
abc080d <区间重叠>
[D - Recording](https://atcoder.jp/contests/abc080/tasks/abc080_d) ``` // https://atcoder.jp/contests/abc080/tasks/abc080_d #include #include using na ......
Atcoder ABC 309 F
# [Atcoder ABC 309 F](https://atcoder.jp/contests/abc309/tasks/abc309_f) ## 题意 n个盒子,长宽高为$x,y,z,$(长宽高是相对的,可以任意调换),问是否有一个盒子可以完全容纳另一个盒子,即存在一个$A_i={x_i,y_ ......
abc079d <Floyed>
[D - Wall](https://atcoder.jp/contests/abc079/tasks/abc079_d) ``` // https://atcoder.jp/contests/abc079/tasks/abc079_d // #include #include #include # ......
abc078d <博弈>
[D - ABS](https://atcoder.jp/contests/abc078/tasks/arc085_b) ``` // https://atcoder.jp/contests/abc078/tasks/arc085_b // // 思路: // 首先注意到两点: // 1. a[n] ......
R语言代做编程辅导ASSIGNMENT FOUR - RANDOM GRAPHS(附答案)
全文链接:https://tecdat.cn/?p=33183 PROBLEM 1) Creating Random Adjacency Matrices Script Name: adjMatrix Input: n... The number of vertices in the graph p ......
abc077d <思维 + 最短路 (将构造数字过程视为最短路)>
[D - Small Multiple](https://atcoder.jp/contests/abc077/tasks/arc084_b) ``` // https://atcoder.jp/contests/abc077/tasks/arc084_b // // 参考: // 1. https ......
AT_abc306_h 题解
# AT_abc306_h Balance Scale 题解 ## Links [洛谷](https://www.luogu.com.cn/problem/AT_abc306_h) [AtCoder](https://atcoder.jp/contests/abc306/tasks/abc306_h ......
abc076d <dp / 贪心>
[D - AtCoder Express](https://atcoder.jp/contests/abc076/tasks/abc076_d) ``` // https://atcoder.jp/contests/abc076/tasks/abc076_d // // dp[i][j] 表示第i秒 ......
acwing -- 3346. 你知道你的ABC吗
简单模拟,最小的两个数字是a, b, 最大的数字时a + b + c #include<iostream> #include<cstdio> #include<algorithm> #include<set> using namespace std; int main() { multiset<in ......