题解 CF1286A 【Garland】】的更多相关文章

updata on 2020.3.19 往博客园搬的时候看了看自己以前写的blog 其实没多久,才两个多月,感觉自己之前写的东西好罗嗦啊.. 但也是最近写的blog才开始多起来 当然现在也没好到哪去... CF1286A题解 整理博客的时候改了一下分类标签,重新审核一下 dp 觉得这题作为一个C比div2的B要简单点吧,算是找回点dp的信心... 首先可以想到,只需关心每个数的奇偶,具体是几不用记录 所以\(0\)表示偶数,\(1\)表示奇数,\(-1\)表示不确定,存在\(a[]\)中 \(n…
C. Nice Garland time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a garland consisting of nn lamps. Each lamp is colored red, green or blue. The color of the ii-th lamp is sisi ('R',…
题目链接:http://codeforces.com/problemset/problem/1108/D time limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard output You have a garland consisting of n lamps. Each lamp is colored red, green or blue. The colo…
Codeforces Round #535 (Div. 3) 题目总链接:https://codeforces.com/contest/1108 太懒了啊~好久之前的我现在才更新,赶紧补上吧,不能漏掉了. A. Two distinct points 题意: 给出两个区间的左右边界,输出两个数,满足两个数分别在两个区间内且这两个数不相等. 题解: 直接输出左端点然后判断一下就行了. 代码如下: #include <bits/stdc++.h> using namespace std; type…
Problem A. Two distinct points [题解] 显然 , 当l1不等于r2时 , (l1 , r2)是一组解 否则 , (l1 , l2)是一组合法的解 时间复杂度 : O(1) [代码] #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; template <typena…
题目链接:http://poj.org/problem?id=1759 Garland Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2477   Accepted: 1054 Description The New Year garland consists of N lamps attached to a common wire that hangs down on the ends to which outermo…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Nothing is eternal in the world, Kostya understood it on the 7-th of January when he saw partially dead four-color garland. Now he has a goal to…
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. Angry Students 题目大意:有t队学生,每个学生有两种状态,生气(A)或不生气(P).(话说为什么生气的戴着圣诞帽哇)所有生气的人都会往前一个人丢雪球,被丢到的人也会变得生气,也会丢雪球.问你每队人中最后一个学生变得生气的时刻. 这题就是统计最长的连续的'P'当然前提是左边有生气的人. 代码…
contest链接:https://codeforces.com/contest/1283 A. Minutes Before the New Year 题意:给一个当前时间,输出离第二天差多少分钟 思路:略 AC代码: #include<iostream> #include<vector> #include<algorithm> #include<cmath> #include<cstring> using namespace std; ; ;…
我要举报本次校赛出题人的消极出题!!! 官方题解请戳:http://3.scnuacm2015.sinaapp.com/?p=89(其实就是一堆代码没有题解) A. 树链剖分数据结构板题 题目大意:我没看,看不懂. 基本思路:我不会. 参考代码:找Oyk老师和Czj老师去. B. The background of water problem 题目大意(大写加粗的水题):给定$N$个学生和他们$K$个科目的成绩$S_i$,再给出各科目$K_i$的权重顺序$Q_i$,求排名之后,拥有id为$X$的…