A. Bark to Unlock time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock…
As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly as possible. To unlock its new phone, Arkady's pet dog Mu-mu has to bark the password once. The phone represents a password as a string of two lowerca…
题:https://codeforces.com/contest/1080/problem/C 题意:给n*m的二维坐标系,每个位置(xi,yi)都表示一个方格,(1,1)的位置是白色,整个坐标系黑白相间分布.有俩个操作,第一个操作是选定一个矩阵用白色给覆盖,第二个操作选定一个矩阵用黑色覆盖,问最后的白色块和黑色块各是多少? 分析:我们先分别独立地求这俩次操作,然后因为黑色覆盖在后,所以我们就把俩次操作可能相交的部分进行减去相应的贡献即可,也就是对面积交进行处理. #include<bits/s…
题目链接: 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…
D. Monitor time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Recently Luba bought a monitor. Monitor is a rectangular matrix of size n × m. But then she started to notice that some pixels ce…
题目 https://ac.nowcoder.com/acm/contest/2?&headNav=www#question 解析 我们对矩阵进行二维hash,所以每个子矩阵都有一个额hash值,二分答案然后O(n^2) check 枚举矩阵终点,记录每个hash值与有两个一样的就true AC代码 #include<bits/stdc++.h> using namespace std; typedef unsigned long long ull; ; ,base2=; //base…
题目链接 Animals and Puzzle 题意  给出一个1e3 * 1e3的01矩阵,给出t个询问,每个询问形如x1,y1,x2,y2 你需要回答在以$(x1, y1)$为左上角,$(x1, y2)$为右下角的子矩阵中,最大的全1正方形的边长. 首先考虑DP预处理. $f[i][j]$表示以$f[i][j]$为右下角的最大的全1正方形的边长. 则$f[i][j] = min(f[i - 1][j], f[i][j - 1], f[i - 1][j - 1]) + 1$ 我们对$f[i][…
A. Bus to Udayland 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 are travelling to Udayland! To get there, they have to get on the special IOI bus. The…
题目链接:http://codeforces.com/problemset/problem/999/F 题目大意:有n个人,n*k张卡牌,每个人会发到k张卡牌,每个人都有一种喜欢的卡牌f[i],当一个人拥有x张喜欢的卡牌时会增加h[x]点愉悦值,求合理的发牌方式使得所有人的愉悦值之和最大,输出最大愉悦值.解题思路:设dp[x][y]表示当x个人拥有同一种喜欢的卡牌且该卡牌有y张时的最大愉悦值.则状态转移的根本取决于第x个人拥有几张喜欢的卡牌,所以得到状态转移方程:for (int i = 0;…
//编写一个函数:从传入的num个字符中找到最长的一个字符,并通过max传回该串地址. //重点:切记这里a[0]就是一个地址. #include<conio.h> #include<stdio.h> #include<string.h> #include<stdlib.h> ], int num, char *max) { max = a[];//切记这里a[0]就是一个地址. ; i < num; i++) { if (strlen(a[i]) &…