上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: 题目链接https://www.nowcoder.com/acm/contest/85/D思路 因为数据范围较小 ,所以 可以直接 一个一个乘 AC代码#include #include #include #include #include #include #inc... 阅读全文
posted @ 2018-03-18 08:45 Dup4 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.nowcoder.com/acm/contest/85/B思路 这个 也是 EAC代码#include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-18 08:44 Dup4 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.nowcoder.com/acm/contest/85/A思路 这个 就是 E 但是 运算的时候 要保证 其精度 AC代码#include #include #include #include #include #include #... 阅读全文
posted @ 2018-03-18 08:42 Dup4 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 思路 先将 N 个 电视节目 排序 根据 结束时间 ,结束的早的 排在前面然后 弄 K个标记 记录 结束时间 然后 遍历一下 每次 如果能插入的话 插入到 结束时间最小的那个 队列里面去然后 每次插入后 更新答案AC代码#include #include #inc... 阅读全文
posted @ 2018-03-17 18:56 Dup4 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 思路 找单词 第一个 单词 是小写 然后 后面的单词 第一位 都是大写 刚开始 初始化 ans = 1 然后 往后遍历 碰到 大写的 更新答案 AC代码#include #include #include #include #include #include... 阅读全文
posted @ 2018-03-17 17:25 Dup4 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 分析给出两个串 从末尾开始对齐 每位对齐后,每一位 遍历如果 第一串 的那位 #include #include #include #include #include #include #include #include #include #include #incl... 阅读全文
posted @ 2018-03-17 17:23 Dup4 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.nowcoder.com/acm/contest/70/B思路没有代码限制 先打表 打出 幸运数字的表 然后 二分查找 第一个 大于 r 的幸运数字 然后 往 L 那边 遍历 求和 AC代码#include #include #incl... 阅读全文
posted @ 2018-03-16 22:00 Dup4 阅读(3281) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.nowcoder.com/acm/contest/70/A思路 暴力每一个子串 用 MAP 标记一下 然后 最后 遍历一遍 MAP 找出 出现次数最多 并且 字典序最小的那个AC代码#include #include #include ... 阅读全文
posted @ 2018-03-16 21:58 Dup4 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-017思路第一个条件是 人群的规模尽可能接近 那么 N 为偶数的时候 就是 一半 一半 N 为奇数的时候 就是 一个 一半 + 1 一个 一半 - 1 第... 阅读全文
posted @ 2018-03-16 16:54 Dup4 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-010思路因为 题意中 朋友的朋友 就是朋友 那么 朋友的关系 用 并查集 保存 但是 敌对关系 只有直接的敌对关系才是具有敌对关系 所以直接用结构体保存就好 AC代码#inclu... 阅读全文
posted @ 2018-03-16 16:26 Dup4 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-009思路用结构体存储,然后结构体排序 注意一下 个人编号是从 1 开始 计数的 AC代码#include #include #include #include #include #... 阅读全文
posted @ 2018-03-16 15:48 Dup4 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-003思路 用贪心思路 最后注意一下 总售价有可能是浮点数 AC代码#include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-16 14:57 Dup4 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L2-015思路 在求和的过程中 标记一下 最大值和最小值,在最后求平均的时候 用总和减去最大值和最小值 去除 (总数 - 2) 然后最后排序的时候 先按升序来排 然后 最后 POP 掉 ... 阅读全文
posted @ 2018-03-16 13:24 Dup4 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-046思路 用同余定理以及模拟除法。AC代码#include #include #include #include #include #include #include #inclu... 阅读全文
posted @ 2018-03-15 22:22 Dup4 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-006思路输出的连续因子 的乘积 也要是这个数的因子 就每个数先找它的单因子 然后每个单因子往上一个一个遍历 当 n % sum != 0 的时候 退出来 然后 比较 此答案 和 ... 阅读全文
posted @ 2018-03-15 21:29 Dup4 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-009思路 每一步每一步 往上加,但是要考虑 溢出,所以用 LONG LONG 而且 每一步 都要约分 才能保证不溢出 最后要考虑 整数部分 和分子部分都为0的情况AC代码#inc... 阅读全文
posted @ 2018-03-15 17:19 Dup4 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 思路 用PYTHON 或 JAVA 干掉AC代码a, b, n = map(int, input().split())for i in range (2, n, 1) : temp = b b = b ** 2 + a a = tempprint(b... 阅读全文
posted @ 2018-03-15 10:50 Dup4 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3961题意 给出两个人的发消息的记录,然后 如果有两人在连续M天及以上 互发消息,超过几天 加几点 友谊值 最后求 友谊值思路先把第一个... 阅读全文
posted @ 2018-03-14 22:01 Dup4 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3960题意首先给出 一系列名字 需要辨别的名字,然后给出Q个问题,每个问题有 若干个人给出答案,给出答案的人 此时状态 为1 没有给出答... 阅读全文
posted @ 2018-03-14 21:57 Dup4 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3959AC代码#include #include #include #include #include #include #includ... 阅读全文
posted @ 2018-03-14 21:54 Dup4 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3958AC代码#include #include #include #include #include #include #includ... 阅读全文
posted @ 2018-03-14 21:52 Dup4 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 思路线段树 区间更新 模板题 注意数据范围AC代码#include #include #include #include #include #include #include #include #include #include #include #include #... 阅读全文
posted @ 2018-03-12 21:27 Dup4 阅读(187) 评论(0) 推荐(1) 编辑
摘要: 题意 给出两个数字 P 和 A 当p 不是素数 并且 满足a^p≡a(mod p) 就输出 yes 否则 输出 no思路 因为 数据范围较大,用快速幂AC代码#include #include #include #include #include #include ... 阅读全文
posted @ 2018-03-11 22:01 Dup4 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一系列数字,输出那个出现次数为奇数次的数字思路 用MAP标记一下,在输入的时候判断一下 之前有没有输入过,如果有,就抹掉 最后剩下的那个 就是出现次数为奇数的 或者可以用 位运算AC代码#include #include #include #include ... 阅读全文
posted @ 2018-03-11 21:58 Dup4 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 题意给出一系列点,求这个多边形面积思路 向量叉积AC代码#include #include #include #include #include #include #include #include #include #include #include #includ... 阅读全文
posted @ 2018-03-11 21:55 Dup4 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一系列数字,判断其中哪三个数字可以构成一个三角形,如果有多个,输出周长最大的那个,如果没有输出 - 1思路 数据较小,所有情况FOR一遍 判断一下AC代码#include #include #include #include #include #includ... 阅读全文
posted @ 2018-03-11 21:54 Dup4 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://poj.org/problem?id=3468思路线段树 区间更新 模板题 在赋初始值的时候,按点更新区间就可以AC代码#include #include #include #include #include #include #include... 阅读全文
posted @ 2018-03-10 21:52 Dup4 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题意 从上到下 或者 从左到右 组成的长度 >= 2 的字符串 如果遇到 # 就断掉 输出 字典序最小的那一个思路只要从上到下 和从左到右 分别遍历一遍,将 长度 >= 2 的字符串 保留下来 就可以了AC代码#include #include #include #... 阅读全文
posted @ 2018-03-10 21:24 Dup4 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题意 给出一系列字符串,然后要排序 排序规则 只按前两位按字典序来排序,如果前两位完全一样,则按输入的顺序来排 思路要用 冒泡排序 不能用STL里面的 SORT 因为它不稳定AC代码#include #include #include #include #includ... 阅读全文
posted @ 2018-03-10 21:19 Dup4 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 题意给出三个数,然后给出一个顺序,有ABC三个字母构成, A是最大的数字 B是中间的数字 C是最小的数字根据 ABC的顺序 给出 数字的顺序思路 先排序一下,然后用 MAP 双向标记一下AC代码#include #include #include #include ... 阅读全文
posted @ 2018-03-10 21:17 Dup4 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题意就是 有一堆容器,然后可以执行加的操作,每个容量是 2, 3, 5, 7, 11, 13, 17, 19然后 有进位 比如第一个 容器,到2了,就会重置为0,然后 下一个容器+ 1, 但是要保证 最后一个容器 不大于等于 19 就可以 算出 最多加多少次,从最低... 阅读全文
posted @ 2018-03-10 21:14 Dup4 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-043思路 将每一次 借出和归还 都用 MAP 标记 如果归还的时候 已经被标记过了 那么 ANS ++ 并且 TIME 也加上相应时间最后 算一下平均时间 要四舍五入AC代码#i... 阅读全文
posted @ 2018-03-09 22:17 Dup4 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-034AC代码#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-09 16:17 Dup4 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-033AC代码#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-09 16:11 Dup4 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-032思路 要分两种情况处理 ①字符串长度 填充长度直接输出 (字符串长度 - 填充长度)个长度的后缀字符串字符就可以AC代码#include #include #include ... 阅读全文
posted @ 2018-03-09 16:00 Dup4 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-030思路 用三个 Vector 来分别存放 整个排名,以及男生的单独排名和女生的单独排名 从整个的排名 从上到下 遍历到 n / 2 的位置 如果第一个出来的是 男生, 那么就从... 阅读全文
posted @ 2018-03-09 15:44 Dup4 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-020思路 对于每个 K >= 2 的朋友圈,里面的所有 ID 都用 MAP 标记一下 对于每个 K == 1 的朋友圈,里面的 ID 只要输入就不用管然后在查找的时候 只要查找一下... 阅读全文
posted @ 2018-03-09 15:34 Dup4 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-031AC代码#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-08 22:32 Dup4 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-039思路先根据 len 和 n 判断 有几个 列和几行,然后 从最右边 到 最左边 从上到下 将字符串 录入 但是要注意 只有 k #include #include #inclu... 阅读全文
posted @ 2018-03-08 22:17 Dup4 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://www.patest.cn/contests/gplt/L1-037AC代码#include #include #include #include #include #include #include #include #include #in... 阅读全文
posted @ 2018-03-08 15:47 Dup4 阅读(110) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 下一页