hihocoder 1631】的更多相关文章

Cats and Fish HihoCoder - 1631 题意: 有一些猫和一些鱼,每只猫有固定的吃鱼速度,吃的快的猫优先选择吃鱼,问在x秒时有多少完整的鱼和有多少猫正在吃鱼? 题解: 模拟一下.两层循环模拟在每一秒时,每个猫的状态是什么样子的,如果在这一秒这个猫没有吃鱼,而鱼还有剩余,那么就给猫吃,如果当前t秒是猫吃鱼速度的倍数,就说明这个猫刚好吃完,又可以给她鱼吃了. #include <bits/stdc++.h> using namespace std; struct node {…
Description There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last week, he won a scholarshi…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last…
时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei is one of the members of the cat club. He loves those cats very much. Last…
hihocoder -1121-二分图的判定 1121 : 二分图一•二分图判定 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 大家好,我是小Hi和小Ho的小伙伴Nettle,从这个星期开始由我来完成我们的Weekly. 新年回家,又到了一年一度大龄剩男剩女的相亲时间.Nettle去姑姑家玩的时候看到了一张姑姑写的相亲情况表,上面都是姑姑介绍相亲的剩男剩女们.每行有2个名字,表示这两个人有一场相亲.由于姑姑年龄比较大了记性不是太好,加上相亲的人很多,所以姑姑一时也…
Hihocoder 太阁最新面经算法竞赛18 source: https://hihocoder.com/contest/hihointerview27/problems 题目1 : Big Plus 描述 Given an NxN 01 matrix, find the biggest plus (+) consisting of 1s in the matrix. size 1 plus size 2 plus size 3 plus size 4 plus 1 1 1 1 111 1 1…
hihoCoder太阁最新面经算法竞赛15 Link: http://hihocoder.com/contest/hihointerview24 题目1 : Boarding Passes 时间限制:10000ms 单点时限:1000ms 内存限制:256MB   描述 Long long ago you took a crazy trip around the world. You can not remember which cities did you start and finish t…
http://hihocoder.com/problemset/problem/1454 调了好长时间,谜之WA... 等我以后学好dp再来看为什么吧,先弃坑(╯‵□′)╯︵┻━┻ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; const int pp = 998244353; const int N = 503; int…
搞了一上午+接近一下午这个题,然后被屠了个稀烂,默默仰慕一晚上学会SAM的以及半天4道SAM的hxy大爷. 题目链接:http://hihocoder.com/problemset/problem/1413 这个题非常的劲! 首先可以发现,每次只变换一个字符为#,所以每次答案一定会得到相应的包含#的答案,而这个方案是可以直接计算出来的. 假设是$S[i]=$#则会得到$i*(N-i+1)$的子串数. 所以每次的答案可以表示为$sum[root]+i*(N-i+1)-ans[i]$,其中$ans[…
问题:http://hihocoder.com/problemset/problem/1148 给定两个日期,计算这两个日期之间有多少个2月29日(包括起始日期). 思路: 1. 将问题转换成求两个日期间有几个闰年 基本公式:闰年数(endYear,startYear) = 闰年数(0, endYear) - 闰年数(0, startYear) 注意点:区间的端点值 2. 闰年的要求 不能被100整除,能被4整除 或能被400整除 3. cnt = [i / 4] 对cnt = [i / 4]取…