2080 : A+B or A-B(点击左侧标题进入zznu原题页面) 时间限制:1 Sec 内存限制:0 MiB提交:8 答案正确:3 提交 状态 讨论区 题目描述 Give you three strings s1, s2 and s3. These strings contain only capital letters A,B,C,D,E. The letters that appear in the string represent a number from 0 to 9.Each…
题目链接:http://acm.swust.edu.cn/problem/0763/ Time limit(ms): 1000 Memory limit(kb): 65535 西南某科技大学的校门外有N排树,每一排树的长度可能不同.每一棵树都用字符作了一个标记. 现在由于学校修建教师公寓,需要在每排树中砍一段连续的树.要求是在每一排树中砍掉的那一段树标记序列都相同. 例如第1排:ABCD,第2排BCDFF,第3排:BRCD,那么我们就可以在每一排树中砍掉CD.请注意下面测试数据的第二组,我们可以…
1514: Packs Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 61  Solved: 4[Submit][Status][Web Board] Description Give you n packs, each of it has a value v and a weight w. Now you should find some packs, and the total of these value is max, total of…
题目:Click here 题意:给你n个点,有多少个正多边形(3,4,5,6). 分析:整点是不能构成正五边形和正三边形和正六边形的,所以只需暴力枚举四个点判断是否是正四边形即可. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define power(x) ((x)*(x)) using names…
Annoying painting tool 题目描述 Maybe you wonder what an annoying painting tool is? First of all, the painting tool we speak of supports only black and white. Therefore, a picture consists of a rectangular area of pixels, which are either black or white.…
博客搬至blog.csgrandeur.com,cnblogs不再更新. 新的题解会更新在新博客:http://blog.csgrandeur.com/2014/01/15/LeetCode-OJ-Solution/ ———————————————————————————————————————— ———————————————————————————————————————— LeetCode OJ 题解 LeetCode OJ is a platform for preparing tech…
usaco ch1.4 sort(d , d + c, [](int a, int b) -> bool { return a > b; }); 生成与过滤 generator&&filter dfs:简化多重循环,枚举点对与判环 洛谷OJ P1209 [USACO1.3]修理牛棚 Barn Repair P1444 [USACO1.3]虫洞wormhole P3650 [USACO1.3]滑雪课程设计Ski Course Design P2693 [USACO1.3]号码锁…
这是一道来自OIerBBS的题目.. 原帖地址:http://www.oierbbs.com/forum.php?mod=viewthread&tid=512?fromuid=71 (似乎是个很小众的BBS..不从洛谷空降根本到不了..) (原帖的排版我忍不了.. 把题目的样式重新处理了一遍..) 题目描述 味味最近对树很感兴趣,什么是树呢?树就是有n个节点和n-1条边形成的无环连通无向图. 味味在研究过程中想知道,对于一个无根树,当节点i作为根的时候树的高是多少.所谓树高指的是从根节点出发,到…
Comet OJ - Contest #5 总有一天,我会拿掉给\(dyj\)的小裙子的. A 显然 \(ans = min(cnt_1/3,cnt_4/2,cnt5)\) B 我们可以感性理解一下,最大的满足条件的\(x\)不会太大 因为当\(x\)越来越大时\(f(x)\)的增长速度比\(x\)的增长速度慢得多 其实可以证明,最大的满足的\(x\)不会超过\(100\) 因为没有任何一个三位数的各位之和大于等于\(50\) 所以我们就直接预处理\(1-99\)所有的合法的 暴力枚举即可 其实…
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法:…