Price List Accepts: 880 Submissions: 2184 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) Problem Description There are nnn shops numbered with successive integers from 111 to nnn in Byteland. Every shop sells only…
描述 http://www.lydsy.com/JudgeOnline/problem.php?id=1621\(n\)头奶牛,刚开始在一起,每次分成\(x\)和\(x+m\)两部分,直到不能再分,问最后一共有几部分. 分析 可以知道当前奶牛数\(n=x+x+m\),所以可以继续分的必要条件是\(n-m>=2\),然后dfs就好了... 对于大数据,\(m=1000\)和\(m=1\)并没有什么区别,所以可以认为搜索时候一直是二分的,所以有\(log_2^n\)层,最下面一层有\(2^{log_…
一道大水题 时间限制: C/C++ 2000ms; Java 4000ms 内存限制: 65535KB 通过次数: 44 总提交次数: 1020 问题描述 Dr. Pan作为上兰帝国ACM的总负责人,对队员的队员的训练也是日常关心,他要求每周要有一位队员出一道题目.不知过了多少年,终于轮到Shiyiliang出题了,他费尽脑汁,终于出了一道大水题 给定一个偶数n,n的取值范围为[-1e18,1e18],要求一对整数x,y满足以下条件: 1.x*y==n 2.x与n必须同号,即如果n>0则x>0…
快速排序有一个特点,就是在排序过程中,我们会从序列找一个pivot,它前面的都小于它,它后面的都大于它.题目给你n个数的序列,让你找出适合这个序列的pivot有多少个并且输出来. 大水题,正循环和倒着循环一次,统计出代码中的minnum和maxnum即可,注意最后一定要输出'\n',不然第三个测试会显示PE,格式错误. #include <iostream> #include <cstdio> #include <algorithm> #include <map&…
如题,大水题...贴个代码完事,就这么任性~~ #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #define INF 0x3f3f3f3f using namespace std; /* 求满足下面的最大的E: 恰好有E个天的行程都大于E miles 从小到大排序,倒着循环一遍,直到最小值<=天数为止,此时的天数-1即为答案. */ +; i…
在这一专辑(最小生成树)中的上一期讲到了prim算法,但是prim算法比较难懂,为了避免看不懂,就先用kruskal算法写题吧,下面将会将三道例题,加一道变形,以及一道大水题,水到不用高级数据结构,建树,画图,最短路径什么的,统统不需要.废话不多说,直接看题: 1.例题精讲 T1: 1348:[例4-9]城市公交网建设问题 时间限制: 1000 ms         内存限制: 65536 KB提交数: 2094     通过数: 650 [题目描述] 有一张城市地图,图中的顶点为城市,无向边代…
链接:Wannafly挑战赛21:C - 大水题 题意: 现在给你N个正整数ai,每个数给出一“好数程度” gi(数值相同但位置不同的数之间可能有不同的好数程度).对于在 i 位置的数,如果有一在j位置的数满足 j < i 且 ai=aj,则你可以将位于[i,j]闭区间内的序列评为“好序列”,然后获得∑gk(j≤k≤i)(此闭区间内“好数程度”之和)分数. 注意: 在所有情况下,每个数都只能被一个”好序列”包含(只能与其他相应数被评为”好序列”一次):在符合要求的情况下,”好序列”的评定次数不受…
题目描述dzy 定义一个 $n^2$ 位的数的生成矩阵 $A$ 为一个大小为 $n \times n$ 且 Aij 为这个数的第 $i \times n+j-n$ 位的矩阵.现在 dzy 有一个数 $n^2$ 位的数 k,他想知道所有小于等于 k 的数的 $n \times n$ 生成矩阵有多少种.(如果不足 $n^2$ 位则补前缀零)输入输出格式输入格式第一行一个数 $n$,第二行一个 $n^2$ 位的数 $k$输出格式仅一行表示答案,答案可能很大,你只需输出答案对 $10^9 + 7$ 取模…
题目:http://codeforces.com/problemset/problem/198/B Jumping on Walls time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya plays a computer game with ninjas. At this stage Vasya's ninja shou…
sum Accepts: 640 Submissions: 1744 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Problem Description Given a sequence, you're asked whether there exists a consecutive subsequence whose sum is divisible by m. outpu…
题目链接: Price List Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 262144/131072 K (Java/Others) Problem Description There are n shops numbered with successive integers from 1 to n in Byteland. Every shop sells only one kind of goods, and the…
点击打开链接 2226: Contest Print Server Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 53  Solved: 18 [Submit][Status][Web Board] Description In ACM/ICPC on-site contests ,3 students share 1 computer,so you can print your source code any time. Here you ne…
Problem Description You are given a sequence of N integers. You should choose some numbers(at least one),and make the product of them as big as possible. It guaranteed that **the absolute value of** any product of the numbers you choose in the initia…
题意:往集合里面添加删除数,集合中的数是按从小到大排列的,询问下标模5等于3的数的和. 记得当时这题不会做, 现在想简单多了,只要维护五个值和左右子树的size大小就行了. #define maxn 100005 struct node { int l,r; int sz; i64 f[]; int mid() { ; } }; node tt[maxn * ]; struct node1 { int id ; i64 x; }; node1 ml[maxn]; void push_up(int…
NanoApe Loves Sequence Accepts: 531 Submissions: 2481 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/131072 K (Java/Others) Problem Description NanoApe, the Retired Dog, has returned back to prepare for the National Higher Education Entr…
1299. bplusa ☆   输入文件:bplusa.in   输出文件:bplusa.out   评测插件 时间限制:1 s   内存限制:128 MB [题目描述] 输入一个整数n,将其拆为两个非负整数a,b,使a,b的和等于n. [输入格式] 输入数据只有一行,为一个整数. [输出格式] 输出数据只有一行,两个整数,中间用一个空格隔开. [样例输入] 5 [样例输出] 2 3 题目链接:http://cogs.cf/cogs/problem/problem.php?pid=1299 分…
Sqrt Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2221    Accepted Submission(s): 882 Problem Description Let's define the function f(n)=⌊n−−√⌋. Bo wanted to know the minimum number y wh…
如题... #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string.h> using namespace std; //太水了好吧... int n; ; ; int main() { scanf("%d",&n); ; int now; ; ;i<n;i++){ scanf(&q…
题意:给出n个人的姓名.性别.ID.分数,让你找出其中哪个妹纸分数最高.哪个汉子分数最低.以及他们的差如果没有妹纸或者汉子,则对应输出Absent,差用NA代替. 就是for一遍找最大最小值,水题 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #include <vector> #defin…
无语,这种水题还出,浪费时间,但又不得不A... #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #define SICKLE 17 #define KNUT 29 using namespace std; int a1,a2,a3; int b1,b2,b3; int main() { scanf(&q…
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h> using namespace std; /* 3 0 180 150 100 7.5 7.2 4.5 */ +; int amounts[maxn]; float price[maxn]; struct Cake{ float amounts; //注意,这里得设置成浮点型,若是int一个样例会过不了…
题目链接:https://www.patest.cn/contests/gplt/L1-035 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 陈越 以上是朋友圈中一奇葩贴:“2月14情人节了,我决定造福大家.第2个赞和第14个赞的,我介绍你俩认识…………咱三吃饭…你俩请…”.现给出此贴下点赞的朋友名单,请你找出那两位要请客的倒霉蛋. 输入格式: 输入按照点赞的先后顺序给出不知道多少个点赞的人名,每个人名占一行,为不超过10个英文…
讲真,这么水的题,我都不怎么好意思扔到博客上来,但是没办法啊,我总得证明一下今天上午我不是在寝室里瞎玩浪费掉的…… 思路就是,把米按单价从小到大排个序,便宜的买的越多越好,直到钱花光为止……我真的都不好意思说这是个贪心……有这么简单的贪心????? #include<cstdio> #include<algorithm> using namespace std; struct Node{ int p,w; }node[+]; int n,m,t; bool cmp(Node a,N…
DESCRIPTION:大意是给你两个字符串.编辑距离只有add和delete会产生.所以.编辑距离最短一定是两个字符串的长度差.然后...呵呵呵呵.... 猜题意就可以了...但是...我觉得这个题很不专业...题面上给的是删除时不输出字符...raner...还是要输出...还有就是...如果恰好当前对应的两个位置刚好相同..还是要modify...逗我玩呢.... 总而言之..已无力吐槽... 附代码: #include<stdio.h>#include<string.h>#…
[题目大意] 给出n个区间,问最多选取多少个区间使得它们互相不重叠. [思路] 水题quq改善心情用.按照右端点大小排序,每次更新上一次的右端点,如果当前左端点大于上次右端点可取. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; +; struct node { int l,r; bool operator <…
Web Navigation Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 32963   Accepted: 14704 ->   Link   <- 本来这种题意一目了然的题就得一遍过的,无奈很多小细节出了问题,表示只要照着题目告诉你的写就可以过了: 还有英语是硬伤!!! 题意:一个浏览器初始网址是"http://www.acm.org/",当浏览新网页时就会有历史记录(就用我们平时用的来讲吧更…
Description 他们经常在一起玩一个游戏,不,不是星际争霸,是国际象棋.毒奶色觉得F91是一只鸡.他在一个n×n的棋盘上用黑色的城堡(车).骑士(马).主教(象).皇后(副).国王(帅).士兵(卒)摆了一个阵.然而F91觉得毒奶色是一只鸡.他发起了挑战:他要操纵一个白色骑士,不经过任何一个棋子的攻击范围(F91可以连续行动,而毒奶色的棋子不会动,除非白骑士进入了对方的攻击范围),并击杀毒奶色的国王(即进入黑国王所在的位置).请告诉F91他最少需要多少步骤来完成这一项壮举. 注意: 当F9…
P2016 战略游戏 树形DP 入门题吧(现在怎么是蓝色标签搞不懂): 注意是看见每一条边而不是每一个点(因为这里错了好几次): #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; int pre[maxn],last[maxn],other[maxn],l; void add(int x,int y) { l++; pre[l]=last[x]; last[x]=l…
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2705 撕逼题.不就是枚举gcd==d,求和phi[ n/d ]么. 然后预处理sqrt (n)的阶乘,RE得不行.发现用到了大于sqrt (n)的阶乘. 然后翻看TJ. 发现phi可以现求!就用那个式子.我竟然都忘了! 注意最后剩下的一个大于sqrt (i)的质因数. #include<iostream> #include<cstdio> #include<cstrin…
这两天刷了两道过去的原题,看看思维还是8太行. 这道题问给出两个字符串,要求只翻转一次,问有几种不同的方法使得a串变成b串 我一开始没看到只翻转一次,还以为是个计数 + 字符串dp大难题,心想当年的学长队伍真厉害啊能上去拿1血,结果仔细看了看发现是个水题,只转一次,那就记录最大相等的串,然后翻过来看相等不相等,然后向外向内拓展看有没有头 == 尾的情况就行了,水题一道,8多说 #include <bits/stdc++.h> using namespace std; #define limit…