![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforce
Knight.Panda
ᕕ(˵•̀෴•́˵)ᕗ上分吗
展开
-
D. Edge Weight Assignment树,猜结论
LINKExamplesinputCopy61 32 33 44 55 6outputCopy1 4inputCopy61 32 33 44 54 6outputCopy3 3inputCopy71 22 73 44 75 66 7outputCopy1 6题意给你一棵树,要你计算出一种符合条件的树最多和最少的权值不同的边的数量,条件...原创 2020-04-13 10:03:00 · 369 阅读 · 0 评论 -
F. Strange Function dp
LINKF. Strange Function dpExamplesinputCopy114 1 3 3 7 8 7 9 10 7 113 5 0 -2 5 3 6 7 8 2 433 7 10outputCopyYES20inputCopy62 1 5 3 6 53 -9 0 16 22 -1442 3 5 6outputCopyNO题意给你一串数组...原创 2020-04-12 14:59:52 · 292 阅读 · 0 评论 -
B. Different Rules 数学/贪心/思维
LINK给人数n,以及某个人在第一场比赛的排名x,在第二场比赛的 排名y,求这个人可能最高的排名以及最低的排名。–>很好的视频题解!!!首先考虑最低的排名可能也就是尽量的有和他排名和相等或者小于它排名和的情况:易得最多的可能是 X+Y-1组和为X+Y的取值情况对于最优排名可能:首先如果X+Y的和小于或者等于n,那么我们都有办法使得其他的选手的排名和大于n如: (1,n),(2...原创 2020-03-03 18:57:17 · 279 阅读 · 0 评论 -
Codeforces Round #624 (Div. 3)
LINK原创 2020-02-27 10:31:06 · 151 阅读 · 0 评论 -
C. Constanze's Machine dp+数学思维
LINK(1)n 1nn 2nnn 3nnnn 5nnnnn 8—斐波那契找规律直接理解的话就是:dp[i]=dp[i-1]+dp[i-2]dp[i-1]表示直接把i位上的n 当成独立的不考虑合并dp[i-2]表示直接把i-1位上的n和i位上的n和并QWQ#include<bits/stdc++.h>using namespace std;const in...原创 2019-12-17 21:30:11 · 155 阅读 · 0 评论 -
D. Portals 思维+贪心+优先队列 /DP
D. PortalsCodeforces Round #608 (Div. 2)题意《凑合看看》:你要攻占敌人的城堡当且仅当全部攻占才有分数,你攻占城堡:你可以选择在攻占的过程中放一个兵看守或选择在攻占之后某一个城堡后把派一个兵回来看守 或者干脆不要这个城堡的分数了,要你求最大的可得到的分数,给出每个城堡的需要兵力,获胜后兵数的增值,以及占领的分数。给出m个边表示城堡之间的连接。–比赛一...原创 2019-12-16 18:35:43 · 313 阅读 · 0 评论 -
E. Nearest Opposite Parity dijkstra+反向建边+超级源点
E. Nearest Opposite Parity//n+1奇数0偶数超级源点int n,a[MAXN];vector<pii>edge[MAXN];int dis[MAXN],vis[MAXN],ans[MAXN];void spfa(int u){ rep(i,n+2) dis[i]=1<<30,vis[i]=0; queue<int...原创 2019-12-16 01:05:24 · 299 阅读 · 0 评论 -
Good Numbers 暴力/进制
C1. Good Numbers (easy version)Good Numbers (hard version) easy version --暴力枚举#include<bits/stdc++.h>using namespace std;typedef long long ll;ll bz[30];int main(){ int tt;cin>>tt...原创 2019-12-11 19:28:26 · 280 阅读 · 0 评论 -
codeforces 1000~1500刷题记录
1218F - Workout plan 数据结构#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N=200010;ll c[N],s[N];int main(){ int n;ll k,t; scanf("%d%lld",&n,&k); for...原创 2019-12-10 17:12:48 · 244 阅读 · 0 评论 -
C. Minimize The Integer 思维题(伪)
C. Minimize The Integer关键就是get到题意,换来换去其实就是保持奇数偶数内部顺序一定,他们之间小的在前面,明白了这个简直就是水题,然而我;;总之记录一下告诫自己,抓准题意啦&#include<bits/stdc++.h>using namespace std;int main(){ int tt;cin>>tt; while(...原创 2019-12-10 16:22:54 · 215 阅读 · 0 评论 -
C. Pie Rules 逆向思维+DP
C. Pie RulesC. Pie Rulestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou may have heard of the pie rule before. It states that if two...原创 2019-12-08 11:50:17 · 248 阅读 · 0 评论 -
Codeforces Round #604 (Div. 2)
Codeforces Round #604 (Div. 2)F - Beautiful Bracket Sequence (easy version)E - Beautiful MirrorsD - Beautiful SequenceC - Beautiful Regional ContestB - Beautiful NumbersA - Beautiful String原创 2019-12-06 23:46:16 · 144 阅读 · 0 评论 -
G. Performance Review线段树
LINKG. Performance Review题意就是一个公司 有一堆员工员工的能力值各不相同,然后之后m年每年会筛掉能力 最后的Ri 位员工 用 (Bi)1, (Bi)2, ⋯, (Bi)Ri 代替他们Q个询问 Xi Yi Zi 表示将第Xi 年的(BXi)Yi 改成Zi.判断M年之后a[1]是否还在公司 1 ,0改变会保留下去(Note that the changes in...原创 2019-10-29 11:24:41 · 286 阅读 · 0 评论 -
K. Addition Robot 2019-2020 ICPC, Asia Jakarta Regional Contest 线段树
LINKK. Addition Robottime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAdding two numbers several times is a time-consuming task, so you want ...原创 2019-10-28 00:23:59 · 267 阅读 · 0 评论 -
//差分+思维 E. Special Permutations Codeforces Round #590 (Div. 3)
LINK 想了两天解释见注释#include<bits/stdc++.h>using namespace std;const int N=2e5+10;typedef long long ll;ll s[N],x[N]; void up(int l,int r,int v)//是差分 { s[l]+=v; s[r+1]-=v;} int main(){...原创 2019-10-05 19:49:13 · 220 阅读 · 0 评论 -
CF基础数学题
CF基础数学题B. Divisors of Two Integerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently you have received two positive integer number...原创 2019-07-17 09:13:27 · 551 阅读 · 0 评论 -
Codeforces Round #579 (Div. 3)
A. Circle of Studentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n students standing in a circle in some order. The index of th...原创 2019-08-20 01:02:23 · 327 阅读 · 0 评论 -
//DP B. The Number of Products Codeforces Round #585 (Div. 2)
B. The Number of Productstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a sequence a1,a2,…,an consisting of n non-zero integer...原创 2019-09-17 00:14:54 · 135 阅读 · 0 评论 -
// 思维 C. Swap Letters Codeforces Round #585 (Div. 2)
C. Swap Letterstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMonocarp has got two strings s and t having equal length. Both strings consist...原创 2019-09-17 00:51:03 · 213 阅读 · 0 评论 -
C. White Sheet
CFC. White Sheettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a white sheet of paper lying on a rectangle table. The sheet is...原创 2019-09-22 08:25:42 · 606 阅读 · 0 评论 -
//贪心+DP F. Wi-Fi Codeforces Round #587 (Div. 3)
CFF. Wi-Fitime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou work as a system administrator in a dormitory, which has nrooms one afte...原创 2019-09-23 00:10:50 · 774 阅读 · 4 评论 -
// 暴力啊 ~C. Anadi and Domino Codeforces Round #588 (Div. 2)
CF LINK DBQ 我丢人#include<bits/stdc++.h>using namespace std;int mp[10][10];int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=1;i<=m;i++) { int x,y;scanf("%d%d",&x,&...原创 2019-09-25 16:52:02 · 109 阅读 · 0 评论 -
D. Marcin and Training Camp Codeforces Round #588 (Div. 2)
CodeForce ExamplesInputCopy43 2 3 62 8 5 10OutputCopy15InputCopy31 2 31 2 3OutputCopy0InputCopy101OutputCopy0NoteIn the first sample test, it’s optimal to send the first, th...原创 2019-09-26 16:20:44 · 184 阅读 · 0 评论 -
//树状数组 OR set +lower_bound D. Distinct Characters Queries Codeforces Round #590 (Div. 3)
LINK-》Codeforces Round #590 (Div. 3)D. Distinct Characters Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a string s c...原创 2019-10-03 22:58:53 · 149 阅读 · 0 评论 -
// dp +位处理相关 bitmask F - Yet Another Substring Reverse Codeforces Round #590 (Div. 3)
LINK-> F - Yet Another Substring ReverseF. Yet Another Substring Reversetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a s...原创 2019-10-03 23:11:05 · 178 阅读 · 0 评论 -
C. 思维 Pipes Codeforces Round #590 (Div. 3)
Codeforces Round #590 (Div. 3)#include<bits/stdc++.h>using namespace std;char s[2][200010];int main(){ int tt;scanf("%d",&tt); while(tt--) { int n;scanf("%d",&n); scanf("%s%s...原创 2019-10-03 23:25:52 · 185 阅读 · 0 评论 -
W/Educational Codeforces Round 68 (Rated for Div.
我要补题。。。A. Remove a Progressiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have a list of numbers from 1to nwritten from left t...原创 2019-07-15 11:12:05 · 102 阅读 · 0 评论