上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页
摘要: Link。 估分:100+60+70+100=330 实际:30+50+20+100=200 大寄! A 没考虑 corner case 死了。 模拟即可,注意 \(n=1\) 时不一定无解,如果是 \(0\) 或者 \(15\) 的话答案显然是 UP 和 DOWN。 B 部分分 特判小数据,注意到 阅读全文
posted @ 2024-10-15 12:40 incra 阅读(48) 评论(0) 推荐(0)
摘要: 典题。 题目不难,注意细节就行。 #include <iostream> #include <iomanip> #include <cstdio> #include <vector> #include <stack> #include <queue> #include <bitset> #inclu 阅读全文
posted @ 2024-10-14 19:13 incra 阅读(51) 评论(0) 推荐(0)
摘要: 由于作者去年 tg 都没一等,文中有错误请大家多多提出。 斜率优化是用来求解一系列 dp 方程形如 \(f_i=\displaystyle\min_{j=1}^{i}\{f_j+a_i+b_j+x_i\times y_j\}\)(其中 \(a_i\) 表示只和 \(i\) 有关的项,\(b_j\) 阅读全文
posted @ 2024-08-06 10:58 incra 阅读(83) 评论(3) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-04-28 14:16 incra 阅读(0) 评论(0) 推荐(0)
摘要: 最大流: int s,t; int h[N],e[M],f[M],ne[M],idx; int q[N],d[N],cur[N]; void add_edge_ (int a,int b,int c) { e[idx] = b; f[idx] = c; ne[idx] = h[a]; h[a] = 阅读全文
posted @ 2024-03-16 07:39 incra 阅读(55) 评论(0) 推荐(0)
摘要: 解决办法:代码中不能存在行末注释 //。 阅读全文
posted @ 2023-12-21 17:24 incra 阅读(126) 评论(0) 推荐(0)
摘要: ```cpp #include #include using namespace std; const int N = 100010,M = 30; int n,m; int w[N]; vector g[N]; int f[N][M],ans[N][M]; void DP1 (int u,int 阅读全文
posted @ 2023-07-06 21:24 incra 阅读(45) 评论(0) 推荐(0)
摘要: ``` #include #include #include using namespace std; const int N = 1000010; int n,m; int a[N],b[N]; int L[N],R[N],pos[N]; int add[N]; void modify (int 阅读全文
posted @ 2023-06-22 15:25 incra 阅读(31) 评论(0) 推荐(0)
摘要: 1. 加入头文件 `` 2. 加入以下哈希函数: ``` struct custom_hash { static uint64_t splitmix64(uint64_t x) { x += 0x9e3779b97f4a7c15; x = (x ^ (x >> 30)) * 0xbf58476d1c 阅读全文
posted @ 2023-06-10 13:17 incra 阅读(112) 评论(0) 推荐(0)
摘要: 题目链接 思路 考虑到如果一些点两两都能互相到达,那么这些点中,只要有一个点是安全的,就可以顾及到其他所有点,而这些点就是强连通分量(SCC)。 思路很简单,就是每一个强连通分量中的最小值相加得到第一问的解,而第二问就是求每一个强连通分量有几个最小值,相乘得到答案。 代码 #include <ios 阅读全文
posted @ 2023-05-11 20:10 incra 阅读(122) 评论(0) 推荐(0)
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 18 下一页