摘要: You are given an matrix M (consisting of nonnegative integers) and an integer K. For any submatrix of M’ of M define min(M’) to be the minimu... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(100) 评论(0) 推荐(0) 编辑
摘要: B. The Bakery time limit per test2.5 seconds memory limit per test256 megabytes inputstandard input outputstandard outputSome time ago Slastyo... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(446) 评论(0) 推荐(0) 编辑
摘要: You are given an array AA , and Zhu wants to know there are how many different array BB satisfy the following conditions?1≤Bi≤Ai1≤Bi≤Ai For ea... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Recently Duff has been a soldier in the army. Malek is her commander.Their country, Andarz Gu has n cities (numbered from 1 to n) and n - 1 bi... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题意:求正方体 n*n*n,固定其中一个点在(0,0,0) 问在正方体里又多少不同的直线。这个题的难点是如果排除掉重复的直线 例如 4,4,4 那么 2,2,2 和 4, 4,4 是相同的推荐两个博客:http://blog.csdn.net/lixuepeng_001/articl... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given 5 integers: a, b, c, d, k, you’re to find x in a…b, y in c…d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y.... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(76) 评论(0) 推荐(0) 编辑
摘要: HDU1695的题目大意是这样的,给你 a , b , c , d , k 五个值 (题目说明了 你可以认为 a=c=1) x 属于 [1,b] ,y属于[1,d] 让你求有多少对这样的 (x,y)满足gcd(x,y)==k。这一题和hdu 6053不一样的地方在于,在hdu60... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(86) 评论(0) 推荐(0) 编辑
摘要: In ACM/ICPC contest, the ”Dirt Ratio” of a team is calculated in the following way. First let’s ignore all the problems the team didn’t pass, ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Give you an array A[1..n]A[1..n],you need to calculate how many tuples (i,j,k) (i,j,k) satisfy that (i j 的情况 只要把每次更新的ak的时候把前面的所有的数都当成是非法... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(66) 评论(0) 推荐(0) 编辑
摘要: Zeus 和 Prometheus 做了一个游戏,Prometheus 给 Zeus 一个集合,集合中包含了N个正整数,随后 Prometheus 将向 Zeus 发起M次询问,每次询问中包含一个正整数 S ,之后 Zeus 需要在集合当中找出一个正整数 K ,使得 K 与 S 的异... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 给定整数N,求1using namespace std;const int maxn=1e7+10; bool vis[maxn]; int prime[maxn],mu[maxn]; int cnt; typedef long long ll;void Init(){ ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(79) 评论(0) 推荐(0) 编辑
摘要: You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character.Let's introduce several definitions:A substring s[i.... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(420) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一个数组,求区间中位数,保证给定区间长度是奇数思路:划分树求区间中位数#include #include #include #include using namespace std;#define MAX_SIZE 100005 int sorted[MAX_SIZE];//已经排好序的... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(61) 评论(0) 推荐(0) 编辑
摘要: Problem I: qwb VS 去污棒 Time Limit: 2 Sec Memory Limit: 256 MB Submit: 95 Solved: 36 [Submit][Status][Web Board] Descriptionqwb表白学姐失败后,郁郁寡欢,... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Zero and One are good friends who always have fun with each other. This time, they decide to do something on a tree which is a kind of graph that ther... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(72) 评论(0) 推荐(0) 编辑
摘要: Do you like painting? Little D doesn’t like painting, especially messy color paintings. Now Little B is painting. To prevent him from drawing ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(117) 评论(0) 推荐(0) 编辑
摘要: #include#define ll long longusing namespace std; const int maxn=100005;const int BUF=30000000;char Buf[BUF],*buf=Buf;inline void read(int&a){for(a=0;*... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Mr. Cui is working off-campus and he misses his girl friend very much. After a whole night tossing and turning, he decides to get to his girl ... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Given two sequences of numbers : a[1], a[2], …… , a[N], and b[1], b[2], …… , b[M] (1 using namespace std;const int maxn=100100 ;int f[maxn]; v... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Liyuan lives in a old apartment. One day, he suddenly found that there was a wireless network in the building. Liyuan did not know the passwor... 阅读全文
posted @ 2017-09-19 21:18 黑码的博客 阅读(117) 评论(0) 推荐(0) 编辑