G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/G Description An owner of a small company FacePalm has recently learned that the city authorities plan to offer to small businesses to partic…
G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/G Description An owner of a small company FacePalm has recently learned that the city authorities plan to offer to small businesses to partic…
G - Good elementsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87954#problem/G Description You are given a sequence A consisting of N integers. We will call the i-th element good if it equals the s…
G. #TheDress Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/G Description After landing on planet i1c5l people noticed that blue and black clothes are quite popular among the locals. Each aboriginal has at least…
G - Good elementsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87954#problem/G Description You are given a sequence A consisting of N integers. We will call the i-th element good if it equals the s…
M. Variable Shadowing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513/problem/M Description In computer programming, variable shadowing occurs when a variable declared within a certain scope has the same name as a variab…
"Cricket Field" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100002 Description Once upon a time there was a greedy King who ordered his chief Architect to build a field for royal cricket inside his park. The King was so…
Problem E. MinimaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description You are given an array x[1 . . . n] and a number m. For all i from 1 to n−m+ 1 find the minimum among x[i], x[i + 1], . . . , x[i +…
题意: 树的根节点为水源,编号为 1 .给定编号为 2, 3, 4, …, n 的点的父节点.已知只有叶子节点都是房子. 有 q 个操作,每个操作可以是下列两者之一: + v ,表示编号为 v 的房子被歹徒占领. - v ,表示歹徒退出编号为 v 的房子. 初始所有房子都没有歹徒.对于每次变化后,要求删除最少的边,使得所有有歹徒的房子均无法与水源连通:同时,在此基础上要求受影响的普通房子数量最少. 题解: 首先对树的根节点的子树分类,那么实际上最多删除的边就是子树个数. 对于每个子树,如果要求受…
题意: 就是n复制m次,然后数mod1e9+7; 思路: 案例:31*10^6 + 31*10^4 + 31*10^2 + 31*10^0 所以就是一个等比数列,然后整理一下就是n*(10^(m*len)-1)/(10^len-1),有个除法就是求下逆元,然后飞马小定理,那么答案就是-看代码- 贴一发挫code- #include <bits/stdc++.h> #include<algorithm> using namespace std; typedef __int64 LL;…