题目描述: D. Vus the Cossack and Numbers Vus the Cossack has nn real numbers aiai. It is known that the sum of all numbers is equal to 00. He wants to choose a sequence bb the size of which is nn such that the sum of all numbers is 00 and each bibi is ei…
Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings aa and bb. It is known that |b|≤|a||b|≤|a|, that is, the length of bb is at most the length of aa. The Cossack considers e…
E. Vus the Cossack and a Field (求一有规律矩形区域值) 题意:给出一个原01矩阵,它按照以下规则拓展:向右和下拓展一个相同大小的 0 1 分别和原矩阵对应位置相反的矩阵,向右下拓展一个和原矩阵相同的矩阵,可以无限拓展,现给出Q个查询 问以 x1,y1,x2,y2为矩阵左上角和右下角的矩形中共有多少个一 reference : https://blog.csdn.net/code92007/article/details/94149487 https://orzsi…
C. Vus the Cossack and Strings Vus the Cossack has two binary strings, that is, strings that consist only of "0" and "1". We call these strings aa and bb. It is known that |b|≤|a||b|≤|a|, that is, the length of bb is at most the length…
Vus the Cossack has nn real numbers aiai. It is known that the sum of all numbers is equal to 00. He wants to choose a sequence bb the size of which is nn such that the sum of all numbers is 00 and each bibi is either ⌊ai⌋⌊ai⌋ or ⌈ai⌉⌈ai⌉. In other w…
题意 : 给你两个只包含 0 和 1 的字符串 a, b,定义函数 f ( A, B ) 为 字符串A和字符串B 比较 存在多少个位置 i 使得 A[ i ] != B[ i ] ,例如 f(00110,01100)=2 f(00110,11000)=4 f(00110,10001)=4 f(00110,00010)=1 问你 取出 a 中 所有 长度 为 lenb (字符串b的长度) 的子串 c, 求 f ( c, b) 为偶数的 c 的个数. 解 : 显然, a 中 存在 lena - l…
A. Vus the Cossack and a Contest 签. #include <bits/stdc++.h> using namespace std; int main() { int n, m, k; while (scanf("%d%d%d", &n, &m, &k) != EOF) { if (min(m, k) >= n) { puts("YES"); } else { puts("NO&quo…
Codeforces Round #571 (Div. 2) 日常被tanao_大佬带飞,我AC了A和C(B题没了...否则tanao_大佬肯定把我吊打) A. Vus the Cossack and a Contest Vus the Cossack holds a programming competition, in which \(n\) people participate. He decided to award them all with pens and notebooks. I…
2019-07-18 09:15:34 这个是练习刷的题 Vus the Cossack and Numbers Vus the Cossack has nn real numbers aiai. It is known that the sum of all numbers is equal to 00. He wants to choose a sequence bb the size of which is nn such that the sum of all numbers is 00…
摘要 本文主要给出了2014-2015 ACM-ICPC, Asia Xian Regional Contest的部分题解,说明了每题的题意.解题思路和代码实现,意即熟悉区域赛比赛题型. Built with Qinghuai and Ari Factor 题意 判断是否是Q数列,只要数列中每个数均能够被3整除就是Q数列. 解题思路 需要特判一下0的情况. 代码 #include <cstdio> int main() { int T; int n; ; scanf("%d"…
摘要: 本文是The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛现场赛)的部分解题报告,给出了出题率较高的几道题的题解,希望熟悉区域赛的题型,进而对其他区域赛的准备有借鉴意义. Function and Function 题意 给出x和k,计算gk(x). 解题思路 通过观察发现,g函数经过一定次数的递推一定会在0和1之间变换,所以循环内加判断提前结束递推即可. 易错分析 注意计算f(0)返回的是1的问题,下面的写法避免了这种错误. 代码实现 #…
Comet OJ - Contest #2 简要题解 cometoj A 模拟,复杂度是对数级的. code B 易知\(p\in[l,r]\),且最终的利润关于\(p\)的表达式为\(\frac{(p-l)(\frac{L+R}{2}-p)}{r-l}\),二次函数求最值即可. code C 枚举独立集点数即可.\(\sum_{i=0}^n\binom nip^{\binom i2}\). code D 树上的任意一个满足\(|S|\ge2\)的点集\(S\)均有一个唯一的中心,即直径的中点(…
Programming Contest Ranking . 题目描述 Heilongjiang Programming Contest will end successfully! And your task is programming contest ranking. The following rules rankings: 1. A problem is solved when it is accepted by the judges. 2. Teams are ranked accor…
题目链接:https://abc115.contest.atcoder.jp/ A Christmas Eve Eve Eve 题目: Time limit : 2sec / Memory limit : 1024MB Score : 100 points Problem Statement In some other world, today is December D-th. Write a program that prints Christmas if D=25, Christmas E…