题目 题意:给你一个n*m由.和#组成的矩阵,.代表可以放,#代表不可以,问在左上角(px,py)到(右下角qx,qy)这样的一个矩阵中,放下一个长度为2宽度为1的牌有多少种放法: #include <iostream> #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ve…
C. New Year and Domino   They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't think so. Limak is a little polar bear who loves to play. He has recently got a rectangular grid with h rows and…
C. New Year and Domino 题目连接: http://www.codeforces.com/contest/611/problem/C Description They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't think so. Limak is a little polar bear who loves…
题意:计算给定矩形面积(r1,c1),(r2,c2)内长度为2的有多少个?向右或向下计算. 思路:预处理字符.分别向右和向下处理.注意边界情况,可能算多了.用容斥原理计算长度为二的单位. #include<iostream> #include<string> #include<algorithm> #include<cstdlib> #include<cstdio> #include<set> #include<map>…
题意:给一些带颜色的点,求一个最小的矩形,恰好包括一半的红色点,且不包括蓝色点. 题解:暴力,求个二维前缀和,用容斥原理更新一下.N很小所以我采用了离散优化,跑了个0ms. 之前没写过二维前缀和,加上离散写得也不是很熟练,所以搞了2个小时,好在是一发就过了.貌似有个坑,线不要特判,不然wa. #include<cstdio> #include<cmath> #include<vector> #include<map> #include<set>…
由于二维条码具有储存量大.保密性高.追踪性高.抗损性强.备援性大.成本便宜等特性,其应用 渐趋广泛,因此二维码的制作对于CODESOFT条码设计软件的用户来讲可谓司空见惯.我们最常见的二维码要数QR码制了,那刚接触CODESOFT 2015条码软件的小伙伴,可能还不是很清楚如何在CODESOFT 2015生成二维码.本文,小编就为大家介绍下在CODESOFT 2015生成二维码的具体操作方法. 查看更多内容请直接前往:http://www.codesoftchina.com/faq/shengc…
D. New Year and Ancient Prophecy time limit per test 2.5 seconds memory limit per test 512 megabytes input standard input output standard output Limak is a little polar bear. In the snow he found a scroll with the ancient prophecy. Limak doesn't know…
B. New Year and Old Property   The year 2015 is almost over. Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary system — 201510 = 111…
A. New Year and Days   Today is Wednesday, the third day of the week. What's more interesting is that tomorrow is the last day of the year 2015. Limak is a little polar bear. He enjoyed this year a lot. Now, he is so eager to the coming year 2016. Li…
B. New Year and Old Property 题目连接: http://www.codeforces.com/contest/611/problem/B Description The year 2015 is almost over. Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly on…
A. New Year and Days 题目连接: http://www.codeforces.com/contest/611/problem/A Description Today is Wednesday, the third day of the week. What's more interesting is that tomorrow is the last day of the year 2015. Limak is a little polar bear. He enjoyed…
前言:这次比赛爆炸,比赛时各种想多,导致写到\(D\)题时思路已经乱了,肝了\(1\)个多小时都没肝出来,\(B\)题中途因为没开\(long\ long\)又被\(HACK\)了..\(C\)题因为在提交前修改的一个疏忽,\(fst\)..瞬间起飞,\(rating\)掉了\(100+\),差点回到\(pupil \quad QAQ\). A. New Year and the Christmas Ornament Description 给出\(a, b, c\)三个数,对于一个公差为\(1…
题目链接:http://codeforces.com/problemset/problem/611/B B. New Year and Old Property time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The year 2015 is almost over. Limak is a little polar bear.…
题目链接:http://codeforces.com/problemset/problem/611/B 题目意思:就是在 [a, b] 这个范围内(1 ≤ a ≤ b ≤ 10^18)统计出符合二进制数表示只有 1 个 0 的数量是多少. *********************** 首先贴出一段绝对会超时的代码,连提交的勇气都木有呢~因为第四组数据已经接近龟速了,所以...(大家可忽略) #include <iostream> #include <cstdio> #includ…
Name Quest time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output A Martian boy is named s — he has got this name quite recently from his parents for his coming of age birthday. Now he enjoys loo…
Mean Requests time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output In this problem you will have to deal with a real algorithm that is used in the VK social network. As in any other company tha…
D. New Year and Ancient Prophecy 题目连接: http://www.codeforces.com/contest/611/problem/C Description Limak is a little polar bear. In the snow he found a scroll with the ancient prophecy. Limak doesn't know any ancient languages and thus is unable to u…
Problem A:http://codeforces.com/problemset/problem/611/A A. New Year and Days 题意:某人要在2016年收集糖果,有两种不同的收集方式,按week或month.x表示week的周x或月的x号,只有到每周或每月的x时才会收集一颗糖果,问:在给定的月或周条件内,2016年能收集多少颗糖果. 思路:我是用数组存好,其实也可以更简洁,周的话除了5,6,7是53个,其他都是52个:月的话1-29都是12(闰年),30是11,31是…
题意:统计在n,m之间的数的二进制表示形式只有一个零的数目. 位运算模拟+dfs #include<iostream> #include<string> #include<algorithm> #include<cstdlib> #include<cstdio> #include<set> #include<map> #include<vector> #include<cstring> #inclu…
F - New Year and Cleaning 这题简直是丧心病狂折磨王.. 思路:容易想到这样一个转换,把整个矩形一起移动,矩形移出去的时候相当于一行或者一列. 为了优化找到下一个消去的点,我先把原数组扩大两倍,用了st表加二分去找,然后就MLE, 我又换了 线段树TLE,最后不把数组扩大两倍ST表+二分过的.. 每次消去的点都是不变的,所以可以做到线性复杂度. #include<bits/stdc++.h> #define LL long long #define fi first #…
C. New Year and Domino time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output They say "years are like dominoes, tumbling one after the other". But would a year fit into a grid? I don't thin…
B. Mishka and trip time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Mishka is a great traveller and she visited many countries. After thinking about where to travel this time, she cho…
题目链接   题意:给出n个矩形,求能覆盖所有矩形的最小的矩形的面积. 题解:对所有点求凸包,然后旋转卡壳,对没一条边求该边的最左最右和最上的三个点. 利用叉积面积求高,利用点积的性质求最左右点和长度,更新面积最小值即可. #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> #define MAX 50010 using namespace std; struct P…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5517 题意:有二元组(a,b),三元组(c,d,e).当b == e时它们能构成(a,c,d)然后,当不存在(u,v,w)!=(a,b,c)且u>=a,v>=b,w>=c时,则是一个better集合里的元素.问这个better集合有几个元素. 题解:当 c.d 相同时对于当前 e 只有 a 最大的时候才有可能是 better 集合里的元素,所以记录相同的 b 中 最大的 a 以及它出现的次数…
D. Vanya and Treasure time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input output standard output Vanya is in the palace that can be represented as a grid n × m. Each room contains a single chest, an the room locat…
Day 1 3月有31天废话 今天先颓过了就只剩30天了 初步计划 每天一道字符串/数据结构题 图论学习 根据<若干图论模型探讨>(lyd)复习 二分图与网络流学习 <算法竞赛进阶指南>剩余std 虚树学习 动态规划学习 DP优化学习 特殊DP学习(排名不分先后):插头DP.计数DP.数位DP.概率期望DP.基环树DP.动态DP Day 2 吐槽一句今天的数据结构题P2824 [HEOI2016/TJOI2016]排序-- 数据是真水,纯暴力拿80 然后就不想想正解了......…
A.\(CDQ\) 分治 特别基础的教程略. \(CDQ\)分治的优缺点: ( 1 )优点:代码量少,常数极小,可以降低处理维数. ( 2 )缺点:必须离线处理. \(CDQ\)分治与其他分治最本质的不同在于: 分治到达\([L,R]\)时,分治处理\([L,mid]\)与\([mid+1,R]\) 然后递归上来合并的时候: 只考虑 [L,mid]中元素 对 [mid+1,R] 中元素的影响 看起来这句话非常简单,但只要正真理解了这句话,也就理解了\(CDQ\)分治. 只要是满足这个原则的分治,…
[友情链接] Day1 今天模拟赛倒数…… 感觉自己菜到爆炸…… 被一个以前初一的倒数爆踩…… 感觉自己白学了. 满分400,自己只有100.真的是倒数第一…… 做了一个T2,其他暴力分全部没有拿到…… 或者是说,思路就是错的? 暑假集训倒数 平常练习倒数 果然逃不过全校最弱的称号…… 没有一点长进啊…… 不过我要吐槽的是啊 我们普及组为什么考紫题啊 也要吐槽一下这个老师(听说大学刚毕业 一脸凶巴巴的样子 女的 为什么在机房不能讨论啊 让我们出去讨论——出去了还讨论什么啊 和我们在一个机房的高二…
因为灵巧实在太弱辽不得不做点noip续下命QQAQQQ 2018 积木大赛/铺设道路 傻逼原题? 然后傻逼的我居然检查了半天是不是有陷阱最后花了差不多一个小时才做掉我做过的原题...真的傻逼了我:( #include<bits/stdc++.h> using namespace std; #define ll long long #define rp(i,x,y) for(register ll i=x;i<=y;++i) +; ll n,d[N],ans; inline ll read…
NOIP2010~2017部分真题总结 2010 (吐槽)md这个时候的联赛还只有4题吗? 引水入城 只要发现对于有合法解的地图,每个蓄水厂贡献一段区间这个结论就很好做了 那么\(O(n^3)\)对每个蓄水厂的dfs一遍,判掉有无解之后贪心线段覆盖 所以这是个爆搜+性质+贪心题? 关押罪犯 贪心+并查集 贪心显然正确,那么并查集维护一下每个点的补集就没了 机器翻译 暴力模拟 乌龟棋 dp \(f[i][j][p][q]\)表示剩余4中卡片多少张,四方枚举dp一下 或者\(f[i][j][p][q…