【10.2GLBP Round-robin //0.8.6】教程文章相关的互联网学习教程文章

10.2GLBP Round-robin //0.8.6

一、实验拓扑:和10.1相同四、验证:1、默认就是Round-robin:轮循下方MAC地址PC3#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet 192.168.10.3 - cc0b.f7cc.0000 ARPA FastEthernet0/0Internet 192.168.10.254 0 0007.b400.0101 ARPA FastEthernet0/0 PC4#show arpProtocol Address Age (min) Hardware Addr Type InterfaceInternet ...

Codeforces Round #462 (Div. 2) + DP【代码】

Codeforces链接 :http://codeforces.com/contest/934A. A Compatible Pair(枚举)??题意 :有两个人分别有一些数字,\(Tommy\) 有 \(n\) 个数字,\(Banban\) 有 \(m\) 个数字, 现在要求 \(Tommy\) 从自己的数字中去掉一个数字,\(Banban\) 要从自己的数字中和 \(Tommy\) 的数字中分别选择一个数字进行乘法运算得到 \(ans\);\(Tommy\) 的目的是让这个值尽量的小,\(Banban\) 的目的是让这个值尽量的大。最后问这个值最大可以是多...

Codeforces Round #373 (Div. 2)【代码】【图】

题目链接:Codeforces Round #373 (Div. 2)分析:只补了B,C,其他题再看看,做出几道说几道,QAQ B题有两种操作,一种是交换两个字母的位置,另一种是改变字母,使得最后序列成为一个形如drdrd/rdrdr的序列。在两种情况中取较小值。   我将奇数与偶数次位置分开处理,如果交换,则两个都加一;如果改变字母,则对应的奇/偶位置++,取两者较大者。详情见代码: 1 #include<cstdio>2 #include<cstring>3 #include<algorith...

Codeforces Round #697 (Div. 3)题解报告(A-G)【代码】

考完雅思了开始康复训练...争取以后每把都打不咕。A.Odd DivisorEditorial:偶数有个特性就是可以一直除2,所以我们只需要判断无限除2之后的奇数是不是1即可。#include<bits/stdc++.h> #pragma GCC optimize(2) #define ll long long #define rep(i,a,n) for(int i=a;i<=n;i++) #define per(i,n,a) for(int i=n;i>=a;i--) #define endl ‘\n‘ #define eps 0.000000001 #define pb push_back #define mem(a,b) memset(a,b,sizeof(a)...

Codeforces Round #720 (Div. 2)【代码】

总算又能安心刷题了 A. Nastia and Nearly Good Numbers 题意: 给定A、B,要求找出三个数 x,y,z。满足条件: x + y = z其中有两个数只能整除A,有一个可以整除A*Bx,y,z 各不相同 思路: 显然,z是最大的,让z整除A*B就行了 。 那么令 x = A*(B-1) , y = A , z = A*B 就行了。 这个时候,可以发现,B不能等于1,同时当B等于2的时候,x 和 y 相等。那么可以令 x = 3A ,y = A ,z = 4A。 Code: #include <bits/stdc++.h> #defi...

Educational Codeforces Round 108 (Rated for Div. 2) C【代码】

#include <bits/stdc++.h> #define priority_queue < ll, std::vector<ll>, std::greater<ll> > mnheap; #define REP(i,a,b) for (auto i = a; i != b; i++) #define ll long long int #define vi vector<int> #define vll vector<ll> #define vvi vector < vi > #define all(c) c.begin(),c.end() #define rall(c) c.rbegin(),c.rend() #define eb emplace_back #define f first #define s second #define pb push_back using nam...

Codeforces Round #402 (Div. 2)【代码】【图】

Codeforces Round #402 (Div. 2) A.日常沙比提#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> usingnamespace std; inline int read(){char c=getchar();int x=0,f=1;while(c<‘0‘||c>‘9‘){if(c==‘-‘)f=-1; c=getchar();}while(c>=‘0‘&&c<=‘9‘){x=x*10+c-‘0‘; c=getchar();}return x*f; } int n,a[10],b[10],ans; int main(){//freopen("in","r",stdin);n=read();for(int...

Codeforces Round #591 (Div. 2, based on Technocup 2020 Elimination Round 1) B. Strings Equalization【代码】

链接:https://codeforces.com/contest/1241/problem/B题意:You are given two strings of equal length s and t consisting of lowercase Latin letters. You may perform any number (possibly, zero) operations on these strings.During each operation you choose two adjacent characters in any string and assign the value of the first character to the value of the second or vice versa.For example, if s is "acbc" ...

【枚举】【贪心】 Codeforces Round #398 (Div. 2) B. The Queue【代码】

卡题意……妈的智障一个人的服务时间完整包含在整个工作时间以内。显然,如果有空档的时间,并且能再下班之前完结,那么直接输出即可,显然取最左侧的空档最优。如果没有的话,就要考虑“挤掉”某个人,就是在某个人之前1分钟到达,这样显然比较优。就这些情况都考虑上就得了。#include<cstdio> using namespace std; typedef long long ll; ll ts,tf,t,a[100010],b[100010],wait=10000000000000ll,ans; int n,num[100010],m; int ...

Codeforces Round #324 (Div. 2) (快速判断素数模板)【代码】【图】

蛋疼的比赛,当天忘了做了,做的模拟,太久没怎么做题了,然后C题这么简单的思路却一直卡到死,期间看了下D然后随便猜了下,暴力了下就过了。A.找一个能被t整除的n位数,那么除了<=10以外,其他都可以用长度为n的10或100,1000 。。。 来往上加几个数而得到#include <iostream> #include <stdio.h> #include <set> #include <algorithm> #include <string.h> usingnamespace std;int getwei(int x) {int sum=0;while(x){sum++;x=x/1...

Codeforces Round #105 (Div. 2) (ABCDE题解)【代码】

比赛链接:http://codeforces.com/contest/148比较简单的一场,最长的一题也才写了30行多一点A. Insomnia curetime limit per test:2 secondsmemory limit per test:256 megabytes?One dragon. Two dragon. Three dragon?, — the princess was counting. She had trouble falling asleep, and she got bored of counting lambs when she was nine.However, just counting dragons was boring as well, so she entertained herse...

HDU5805 NanoApe Loves Sequence (BestCoder Round #86 B)前后缀预处理【代码】【图】

分析:维护空隙的差,然后预处理前缀最大,后缀最大,扫一遍#include <cstdio> #include <cstring> #include <cmath> #include <algorithm> usingnamespace std; typedef longlong LL; constint N = 1e5+5; int a[N],T,n,b[N],l[N],r[N]; int main(){scanf("%d",&T);while(T--){scanf("%d",&n);for(int i=1;i<=n;++i)scanf("%d",&a[i]);LL ret=0;for(int i=1;i<n;++i){b[i]=abs(a[i]-a[i+1]);l[i]=max(l[i-1],b[i]);}r[n]=0;for(in...

Codeforces Round #428C【代码】

Journey题意:给一颗树,边权都为1,从1出发,求走到叶子节点的边权和的期望(每次往孩子遍历的等概率的)思路:从1出发dfs,每个点到下一个点的概率是当前节点的概率乘孩子节点的个数,也就是当前点的边数-1,到叶子节点后计算概率乘边权和然后相加就是了,1节点需要特殊处理一下AC代码:#include "iostream" #include "iomanip" #include "string.h" #include "stack" #include "queue" #include "string" #include "vector" #in...

Codeforces Round #418 (Div. 2) C. An impassioned circulation of affection(双指针)【代码】

题目链接:Codeforces Round #418 (Div. 2) C. An impassioned circulation of affection题意:给你一个字符串,有q个询问,每个询问一个x和一个字符 o。现在让你在原来的字符串上最多改变x个字符,问能构成最长的o子串的长度。题解:一共有26*1500种状态,对于每个状态用双指针滚一滚就行了。 1 #include<bits/stdc++.h>2#define F(i,a,b) for(int i=(a);i<=(b);++i)3usingnamespace std;4 5constint N=1507;6int ans[27][N],n,k,...

Educational Codeforces Round 78 题解【代码】

A题水题,但是我做麻烦了,因为我不知道字符串内部也可以排序,学到一招#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> usingnamespace std; constint N=1e5+10; constint inf=0x3f3f3f3f; int a[27],b[27]; int main(){int t;cin>>t;while(t--){string p;string s;cin>>p>>s;int i;int l1=s.size();int l2=p.size(); int flag=0;if(l1<l2){cout<<"NO"<<endl;continue;}for(i=0;i<l1...