Codeforces Round #538 (Div. 2) 题目链接:https://codeforces.com/contest/1114 A. Got Any Grapes? 题意: 有三个人,有三种食物,食物对应的数量为a,b,c,三个人需要的食物量分别为x,y,z. 现在第一个人只吃第一种食物,第二个人只吃前两种食物,第三个人都要吃.问准备的食物数量是否能够满足这三个人. 题解: 简单模拟一下就行了. 代码如下: #include <bits/stdc++.h> using name…
Codeforces Round #538 (Div. 2) (CF1114)   今天昨天晚上的cf打的非常惨(仅代表淮中最低水平   先是一路缓慢地才A掉B,C,然后就开始杠D.于是写出了一个O(n^2)的线性dp,然后就wa6,调到结束.结束后发现完全看漏了两句话.噢,起始点!!!   好吧然后算算自己有可能这一场要变成+0,反正在0左右. 结束后开始然后开始写D,顺便思考F.结果写完D发现A怎么fst了,然后...因为习惯于对相似的语句复制粘贴,有些东西没有改--三句话都在 -a!!!(…
任意门:http://codeforces.com/contest/1114/problem/D D. Flood Fill time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a line of nn colored squares in a row, numbered from 11 to nn f…
目录 Codeforces 1114 A.Got Any Grapes? B.Yet Another Array Partitioning Task C.Trailing Loves (or L'oeufs?) D.Flood Fill(区间DP) E.Arithmetic Progression(交互 二分 随机化) F.Please, another Queries on Array?(线段树 欧拉函数) Codeforces 1114 比赛链接 貌似最近平均难度最低的一场div2了...…
C. Coloring Trees time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output ZS the Coder and Chris the Baboon has arrived at Udayland! They walked in the park where ntrees grow. They decided to be n…
#include<bits/stdc++.h>using namespace std;int a[5007];int dp[5007][5007];int main(){    int n; scanf("%d",&n);    for(int i=1;i<=n;i++)        scanf("%d",&a[i]);    n=unique(a+1,a+1+n)-a-1;    for(int i=n;i>=1;i--)…
https://codeforces.com/contest/1114/problem/F 欧拉函数 + 区间更新线段树 题意 对一个序列(n<=4e5,a[i]<=300)两种操作: 1. 将a[l,r]的数字乘以x(x<=300) 2. 求\(\varphi(\prod_{i=l}^ra[i])\)对1e9+7取模 题解 欧拉函数性质 假如\(p\)是一个质数,\(\varphi(p)=p-1\),\(\varphi(p^k)=p^{k-1}*(p-1)=p^k*\frac{p-1}…
https://codeforces.com/contest/1113/problem/C 题意 一个n个数字的数组a[],求有多少对l,r满足\(sum[l,mid]=sum[mid+1,r]\),sum为异或和(n<=3e5,a[i]<=2^20) 题解 异或和为零的区间可以分成任意两个区间(这两个区间的异或和相等) 定义dp[i][j]为异或和为i,下标为j(只记录奇偶)的前缀个数 枚举r,然后累加l 代码 #include<bits/stdc++.h> #define M…
题目链接: http://codeforces.com/problemset/problem/213/B B. Numbers time limit per test 2 secondsmemory limit per test 256 megabytes 问题描述 Furik loves writing all sorts of problems, especially such that he can't solve himself. You've got one of his proble…
题目链接: http://codeforces.com/problemset/problem/214/B Hometask time limit per test:2 secondsmemory limit per test:256 megabytes 问题描述 Furik loves math lessons very much, so he doesn't attend them, unlike Rubik. But now Furik wants to get a good mark fo…