超短文警告! 埃氏筛: #include <iostream> #include <cstring> #include <stdio.h> #define HRiver2 return #define Warma 0 #define ll long long #define maxn 114514 ...
分类:
其他好文 时间:
2021-03-08 13:23:25
阅读次数:
0
题目链接 题解 下文将点$x,y$间的最短路长度称为$<x,y>$ 若将边$i$的权值赋为$0$,对于每组$a_j,b_j$有两种情况:最短路经过/不经过$i$。经过的情况花费$=<a_j,u_i>+<b_j,v_i>\(或\)<a_j,v_i>+<b_j,u_i>\(,不经过的情况预处理出未更改边 ...
分类:
其他好文 时间:
2021-03-08 13:21:10
阅读次数:
0
#include <bits/stdc++.h> using namespace std; int ans,a[1000],dp[1000],n; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } for( ...
分类:
其他好文 时间:
2021-03-08 13:08:20
阅读次数:
0
rope (类似于块状链表的结构) 需要增加的预处理指令: #include<ext/rope> using namespace __gnu_cxx; rope<int> rp; 基本操作: 在末尾插入 \(x\) : rp.push_back(x); 在 \(pos\) 处插入 \(x\) : r ...
分类:
其他好文 时间:
2021-03-06 15:01:46
阅读次数:
0
Aragorn's Story - 树链剖分 - HDU 3966 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 5e4+5; int n, m, p; char op[5]; in ...
分类:
其他好文 时间:
2021-03-06 14:20:12
阅读次数:
0
B. Berland Crossword \(直接去枚举四个角落,注意枚举的方法,本题如何写的简洁很关键.\) #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0 ...
分类:
其他好文 时间:
2021-03-05 13:15:01
阅读次数:
0
如果一个数组$[a_1,a_2,a_3,...,a_n]a_1=n-1$并且$a1>0$,这个数组就被叫为好数组,如果一个序列能正好分为多个好数组,ta就被叫为好序列,现在给定一个序列,求这个序列有多少好子序列,答案对$998244353$取模 ...
分类:
其他好文 时间:
2021-03-05 13:10:49
阅读次数:
0
我发现平面图转对偶图经常和最小割在一起。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long int ll; 4 typedef long double ld; 5 typedef pair<int,int> pi ...
分类:
其他好文 时间:
2021-03-05 13:00:48
阅读次数:
0
问题描述 求 \(a\) 乘 \(b\) 对 \(p\) 取模的值。 \(1≤a,b,p≤10_{18}\) 问题分析 $a * b$会爆炸long long,考虑将b视为二进制数,只需要执行$log_b$次加法并实时取模即可不爆long long完成乘法的计算 代码实现 #include <ios ...
分类:
其他好文 时间:
2021-03-05 12:57:03
阅读次数:
0
C - Cross-Stitch tag: 构造, 欧拉回路 题意 十字绣穿针引线,保证 'X' 八联通 思路 这样构造,然后正反跑欧拉回路 #include<bits/stdc++.h> using namespace std; const int N = 3e5 + 10; typedef lo ...
分类:
其他好文 时间:
2021-03-03 12:15:26
阅读次数:
0