
补题
The sunshine。
实在是太菜了 记忆力也不太好,,我还是写博客记录一下吧wuwuwuwu
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
拓扑排序(反向建图)poj3687
翻译版本的题意哈哈哈哈 : Windy有N个球,重量从1个单位到N个单位不等。现在他试图用1到N来标记它们,这样: 没有两个球有相同的标签。 标记满足几个约束条件,如“标有a的球比标有b的球轻”。你能帮温迪找到解决办法吗 输入 的第一行是测试用例的数量。每个测试用例的第一行包含两个整数,N(1≤N≤200)和M(0≤M≤40000)。下一个M行包含两个整数a和b,表示标有a的球必须比标有b的球轻。(1≤a,b≤N)每个测试用例前都有一个空行。 输出 对于每一个测试用例输出一行从标签原创 2020-10-06 16:25:55 · 379 阅读 · 0 评论 -
51 nod 四级题目(同余定理)
51nod四级题 #include<cstdio> #include<iostream> #include<algorithm> #include<cmath> #include<queue> using namespace std; const int maxn = 1e6 + 5; typedef long long ll; struct node{ string s; ll num; }; ll vis[maxn]; queue<.原创 2020-09-24 12:01:01 · 488 阅读 · 0 评论 -
HDU多校第七场(Increasing and Decreasing)
HDU 多校第七场 /* 题意:给一个数n,构造一个只能使用1 ~ n里面的数仅一次 且需要完全使用n个数的序列,要求最长上升子序列的长度是x 最长下降子序列的长度为y 思路:就是先将1,2,3....n的后y个数翻转 然后将n - y个数分成x - 1份 在每一份中各取一个 限制条件: 1 <= (n - y) / (x - 1) <= y */ #include<bits/stdc++.h> using namespace std; typedef long long l原创 2020-09-17 11:29:02 · 148 阅读 · 0 评论 -
HDU多校第五场1009(二项式定理、快速幂、逆元)
(可恨的剪纸游戏) hdu多校第五场1009 这个规律是真的很讨厌,我比赛的时候撕了那么多的纸,结果却把自己绕了进去,还是哭唧唧 /* 这道的关键: 1.向左和向右是等价的,向上和向下是等价的 可以归并为横折和竖折 2.从中心横折和竖折造成的结果 横折x次可以产生2^x + 1条割痕 竖折x次可以产生2^x + 1条割痕 所以结果就是2 ^ k + 1 + 2 ^ (n - k) + 1求和; 用到的知识就是二项式定理、快速幂和逆元 */ #include<bits/stdc原创 2020-08-05 15:03:36 · 152 阅读 · 0 评论 -
牛客多校第八场 I题(离散化+并查集)
牛客多校第八场 I题 所有解释都在代码注释里了,哈哈哈 #include<bits/stdc++.h> using namespace std; const int maxn = 3e5 + 5; map<int,int>mp; int pre[maxn]; int find(int x){ if(x == pre[x]) return x; else return pre[x] = find(pre[x]); } int main(){ int t; sc原创 2020-08-05 13:57:26 · 167 阅读 · 0 评论 -
牛客多校第五场(D:一个环的最长上升子序列)
题目链接 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int a[maxn]; int dp[maxn]; int main(){ int n; scanf("%d",&n);/*环的最长上升子序列*/ for(int i = 1;i <= n;i++){ scanf("%d",&a[i]); a[i + n] = a[i];/*----*/ } dp[0]转载 2020-07-27 09:22:53 · 198 阅读 · 0 评论 -
HDU多校1005 -------DP
hdu 多校1005 //hdu 1005 #include<bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; const int mod = 1e9 + 7; typedef long long ll; ll dp[maxn]; string s[maxn]; int main(){ int t; cin >> t; while(t--){ int n; cin >> n; m原创 2020-07-30 19:40:46 · 152 阅读 · 0 评论 -
codeforces660 B(长记性)
codeforces 660 B #include<bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ int n; scanf("%d",&n); int m; if(n % 4 == 0) m = n / 4; else m = n / 4 + 1; for(int i = 1;i <= n - m;i++) printf原创 2020-07-31 13:20:07 · 162 阅读 · 0 评论 -
牛客多校第七场H(数论分块)
牛客多校第七场H:数论分块 + 思维 专题里面有,后悔没写,哭唧唧 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 1e9 + 7; ll n,k; ll run(ll x){ ll j;/*i是前界,j是后界*/ ll res = 0; for(ll i = 2;i <= min(x,k);i = j + 1){ ll y = x / i; j = min(原创 2020-08-03 15:56:41 · 184 阅读 · 0 评论 -
每日补题
#include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; typedef long long ll; int n; ll x,k,a[maxn]; int main(){ scanf("%d%lld%lld",&n,&x,&k); for(int i = 0;i <...原创 2020-04-17 16:56:10 · 163 阅读 · 0 评论