
基础题
文章平均质量分 77
DOLFAMINGO
诗酒趁年华
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Gym - 100676E —— 基础题
题目链接:https://odzkskevi.qnssl.com/1110bec98ca57b5ce6aec79b210d2849?v=1490453767 题解: 这种方法大概跟离散化扯上点关系:首先直接用数组去接这组输入,然后对数组进行排序。之后把相等的数并在一起,并统计他们的个数,这样就重新得到两个数组,一个记录数字val,另一个记录个数sum。然后计算就可以了。 代码原创 2017-03-27 21:54:18 · 470 阅读 · 0 评论 -
Codeforces Round #374 (Div. 2) B. Passwords —— 基础题
题目链接:http://codeforces.com/contest/721/problem/B B. Passwords time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard ou原创 2017-05-13 14:58:17 · 511 阅读 · 0 评论 -
Codeforces Round #376 (Div. 2) A. Night at the Museum —— 循环轴
题目链接: http://codeforces.com/contest/731/problem/A A. Night at the Museum time limit per test 1 second memory limit per test 256 megabytes input standard input output s原创 2017-05-31 16:13:56 · 392 阅读 · 0 评论 -
CSU - 1530 Gold Rush —— 二进制
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1530 题解: 对于一块2^n质量的gold。需要把它分成a质量和b质量(a+b=2^n),且每次分时是平分。问至少要平分多少次? 其实只需要知道最小分块的质量,就能知道它分了多少次。 比如当a=5, b=3,n=3时: 2^3: 1000 5 : 0101原创 2017-04-25 14:04:21 · 376 阅读 · 0 评论 -
Codeforces Round #374 (Div. 2) A. One-dimensional Japanese Crossword —— 基础题
题目链接:http://codeforces.com/contest/721/problem/A A. One-dimensional Japanese Crossword time limit per test 1 second memory limit per test 256 megabytes input standard input原创 2017-05-13 14:04:57 · 1530 阅读 · 0 评论 -
Codeforces Round #373 (Div. 2) A. Vitya in the Countryside —— 基础题
题目链接:http://codeforces.com/contest/719/problem/A A. Vitya in the Countryside time limit per test 1 second memory limit per test 256 megabytes input standard input outpu原创 2017-05-13 13:50:30 · 329 阅读 · 0 评论 -
Gym - 100187F F. Doomsday —— 基础题
题目链接:http://codeforces.com/gym/100187/problem/F 题解: 将人和洞排个序,然后再从左到右将人放进洞里。 #include #include #include #include #include #include #include #include #include #include #include //#define LOCAL usi原创 2017-04-19 21:39:19 · 402 阅读 · 0 评论 -
Codeforces Round #261 (Div. 2) B. Pashmak and Flowers 水题
题目链接:http://codeforces.com/problemset/problem/459/B 题意: 给出n支花,每支花都有一个漂亮值。挑选最大和最小漂亮值得两支花,问他们的差值为多少,并且有多少种选法(无先后顺序)。 现场做时,想到的是:用multimap记录每个漂亮值出现的次数,并不断更新最大最小值。 这个方法很笨,而且multimap的val值是多余的。 需要注意原创 2017-03-24 15:01:59 · 409 阅读 · 0 评论 -
Gym - 100676D Sudoku 基础题
题目: 题解: 方法1:用STL的set,把每个数放到相应的集合。在放之前如果找到相同的数,则invalid。 方法2:由于数字只有1~9,可以开vis[]数组,记录每行,每列,每格是否已经放了某个数,如果放了,就标记为1。row[9][10] , col[9][10], grid[3][3][10]; 方法3:分别计算每行,每列,每格的数字和,如果全为4原创 2017-03-27 21:35:21 · 341 阅读 · 0 评论 -
UVALive - 4867 —— dp
题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2868 用暴力也过了: #include #include #include #include #include #include #include #in原创 2017-03-27 22:12:51 · 406 阅读 · 0 评论 -
POJ2389 —— 高精度乘法
直接上代码了: #include #include #include #include #include #include #include #include #include #include #define LL long long #define MAX(a,b) (a>b?a:b) #define MIN(a,b) (a<b?a:b) using namespace std;原创 2017-03-27 21:58:03 · 416 阅读 · 0 评论 -
Codeforces Round #379 (Div. 2) D. Anton and Chess —— 基础题
题目链接:http://codeforces.com/contest/734/problem/D D. Anton and Chess time limit per test 4 seconds memory limit per test 256 megabytes input standard input output stand原创 2017-06-11 10:26:16 · 338 阅读 · 0 评论