上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5265 想多了 如果m = n,肯定时n个dish中用时最多的 如果m using namespace std; int test; int n, m; int x; l 阅读全文
posted @ 2019-05-01 12:43 Youpeng 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=5742 AC代码: 阅读全文
posted @ 2019-04-27 20:39 Youpeng 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题目链接: 很简单的一个bfs题,是我想多了。 顺便学习一下C++的STL中的vector的用法:https://www.cnblogs.com/youpeng/p/10779019.html 阅读全文
posted @ 2019-04-27 16:43 Youpeng 阅读(205) 评论(0) 推荐(0) 编辑
摘要: C++ STL 之vector用法总结 粘贴自: 介绍 1. vector是表示可变大小数组的序列容器。 2. 就像数组一样,vector也采用的连续存储空间来存储元素。也就是意味着可以采用下标对vector的元素进行访问,和数组一样高效。但是又不像数组,它的大小是可以动态改变的,而且它的大小会被容 阅读全文
posted @ 2019-04-27 15:56 Youpeng 阅读(8272) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4016 直接用栈爆内存,看网上大神用数组实现的,构思巧妙,学习了! AC代码: 又看到网上一个用list实现的 include include using names 阅读全文
posted @ 2019-04-27 11:44 Youpeng 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=4024 从前往后找满足alar的最小下标r,如果l=r且1 include using namespace std; const int maxn = 100005; 阅读全文
posted @ 2019-04-26 22:22 Youpeng 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 粘贴自: 还是不要用了,做ZOJ 4016( )还是会超时啊,还是老老实实用scanf和printf吧! 在C++中的输入和输出有两种方式,一种是scanf和printf,另一种是cin和cout,在 include这个万能头文件下,这两种方式是可以互换的 C++和C很相似,很多大佬都用C++写C, 阅读全文
posted @ 2019-04-21 16:07 Youpeng 阅读(2069) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/567/C AC代码: / 枚举中值a[i],然后开一个mp1维护中值前的a[i]/k这个数的个数, 再开一个mp2维护中值后的a[i] k这个数的个数,2者相乘即是等比数列的个数。 / include in 阅读全文
posted @ 2019-04-21 15:10 Youpeng 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/450/A / 计算一个人要是拿足够离开需要排多少次队,选排的次数多的那个人,如果两个人排的次数相同,那么要取后者; / include using namespace std; int main() { i 阅读全文
posted @ 2019-04-21 14:16 Youpeng 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/471/A 题目数据规模1 ~ 9,可以用一个数组进行计数,减掉出现四次的数,看看还有几个是非零数,有一个就是大象,有两个就是北极熊;如果没有四个数的,那就是Alien。 AC代码: include usin 阅读全文
posted @ 2019-04-21 13:23 Youpeng 阅读(107) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页