B. Weakened Common Divisor time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mat…
题目链接 让你找一个数,使得这个数,可以被每个二元组的两个数中的一个数整除. 先将第一个二元组的两个数质因数分解一下,分解的质数加入set中,然后,对剩下的n-1个二元组进行遍历,每次遍历到的二元组对s中的质数进行判断是否能整除.如果某个质数可以被n-1个二元组整除(两个数中的一个). 好浅显的思路,,,可是我就是没想到,,,哭辽,xyqnb mdhnb fyznb %大佬 #include<bits/stdc++.h> #define LL long long #define fi firs…
A : A. Doggo Recoloring time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Panic is rising in the committee for doggo standardization — the puppies of the new brood have been born multi-colore…
我们知道不满足的肯定是两边大中间小的,这样就用RMQ查询两个相同等值的区间内部最小值即可,注意边界条件 #include<bits/stdc++.h> #define x first #define y second #define ok cout << "ok" << endl; using namespace std; typedef long long ll; typedef unsigned long long ull; typedef ve…
#include<iostream> #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; ]; int main(){ int k,n; int zk; int yk; while(~scanf("%d%d",&n,&k)){ zk=; yk=; scanf("%s",s); int lens=str…
#include<iostream> #include<algorithm> #include<stdio.h> #include<string.h> using namespace std; ]; ]; int main() { int n,m; int lena; int lenb; while(~scanf("%d%d",&n,&m)) { scanf("%s",a); scanf("%…
http://codeforces.com/contest/948/problem/A A. Protect Sheep Bob is a farmer. He has a large pasture with many sheep. Recently, he has lost some of them due to wolf attacks. He thus decided to place some shepherd dogs in such a way that all his she…
题: OvO http://codeforces.com/contest/947/problem/D 923D 947D 948E 解: 记要改变的串为 P1 ,记目标串为 P2 由变化规则可得: 1. B -> AC -> AAB -> AAAC -> C ( 即 B -> C -> B ) 2. AB -> AAC -> AAAB -> B (即 AB -> B ) 3. B -> AC -> AB ( 即 B -> AB…