Loading

随笔分类 -  刷题笔记----------

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页
摘要:Educational Codeforces Round 93 (Rated for Div. 2) A. Bad Triangle input 3 7 4 6 11 11 15 18 20 4 10 10 10 11 3 1 1 1000000000 output 2 3 6 -1 1 2 3 N 阅读全文
posted @ 2020-08-15 09:43 RioTian 阅读(220) 评论(0) 推荐(2)
摘要:思路:这道题是对于一串数字,每给定一个位置,就指出从这个位置往右一直到最后一个元素之间有多少不重复的数字。 涉及到数字重复问题,想到用map处理。再用动态规划,从后往前依次加一或者不变既可。 #include<iostream> #include<cstring> #include<algorith 阅读全文
posted @ 2020-08-14 22:12 RioTian 阅读(164) 评论(0) 推荐(0)
摘要:P问题,NP问题,NPC问题?这些都是计算机科学领域,关于算法方面的术语。在认识这些术语之前,建议同学们先认真学习一下算法的时间复杂度,因为算法的时间复杂度与P,NP和NPC问题高度相关。 什么是P问题? P是英文单词Polynomial的首字母,多项式的意思。 如果问题可以通过一个多项式复杂度的算 阅读全文
posted @ 2020-08-14 16:23 RioTian 阅读(2432) 评论(1) 推荐(2)
摘要:A:Machine Schedule 输入 5 5 10 0 1 1 1 1 2 2 1 3 3 1 4 4 2 1 5 2 2 6 2 3 7 2 4 8 3 3 9 4 3 0 输出 3 在二分图中我们经常要找题目中的 “0要素” 和 “1要素” ,作为解答的突破口。 二分图最小覆盖模型的特点则 阅读全文
posted @ 2020-08-14 16:05 RioTian 阅读(339) 评论(0) 推荐(0)
摘要:Example input 6 3 1 4 2 10 3 10 2 16 4 16 5 output YES YES NO YES YES NO 解题思路:首先我们应该知道:偶数个奇数相加一定是偶数,奇数个奇数相加一定是奇数,所以对于给出的n和k,如果n是偶数,k是奇数,或者n是奇数,k是偶数,n和 阅读全文
posted @ 2020-08-14 11:21 RioTian 阅读(141) 评论(0) 推荐(0)
摘要:Recall that the sequence b is a a subsequence of the sequence a if b can be derived from a by removing zero or more elements without changing the orde 阅读全文
posted @ 2020-08-14 11:02 RioTian 阅读(152) 评论(0) 推荐(0)
摘要:Codeforces Round #628 (Div. 2) A. EhAb AnD gCd Description 给定一正整数 \(x\),求正整数$a,b$,使得 \(gcd(a,b) + lcm(a,b) = x\)。 Solution 取 \(a = 1\) 即可。 #include<bi 阅读全文
posted @ 2020-08-14 10:18 RioTian 阅读(123) 评论(0) 推荐(0)
摘要:A: 石子合并 所求问题:1到n这些石子合并最少需要多少代价 由于石子合并的顺序可以任意,我们将石子分为两个部分 子问题:1到k这堆石子合并,k+1到n这堆石子合并,再把两堆石子合并,需要多少代价$(1<=k<=n)$ 那么便可以得到状态转移方程 \(dp[i][j]=min(dp[i][k]+dp 阅读全文
posted @ 2020-08-13 16:30 RioTian 阅读(284) 评论(0) 推荐(0)
摘要:1395A - Boboniu Likes to Color Balls 如果在r,b,g,w中小于或等于一个奇数,则可以将其定为回文。 否则,请进行一次操作(如果可以),然后检查上述情况。 进行多次操作是没有意义的,因为我们只关心r,b,g,w的奇偶性 #include<bits/stdc++.h 阅读全文
posted @ 2020-08-13 14:33 RioTian 阅读(287) 评论(1) 推荐(1)
摘要:Description People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there 阅读全文
posted @ 2020-08-12 20:24 RioTian 阅读(190) 评论(0) 推荐(0)
摘要:题目大意: 在遥远的国家佛罗布尼亚,嫌犯是否有罪,须由陪审团决定。陪审团是由法官从公众中挑选的。先随机挑选n 个人作为陪审团的候选人,然后再从这n 个人中选m 人组成陪审团。选m 人的办法是:控方和辩方会根据对候选人的喜欢程度,给所有候选人打分,分值从0 到20。为了公平起见,法官选出陪审团的原则是 阅读全文
posted @ 2020-08-12 20:00 RioTian 阅读(204) 评论(0) 推荐(0)
摘要:题目: 有N个学生合影,站成左端对齐的k排,每排有 $N-1,N_2,…N_k$个人,第一排在最后面。学生的身高互不相同,分别为$1-N$,并且合影时要求每一排从左往右身高递减,每一列从后往前身高递减,问有多少种安排合影的方案 。\(N <=30, k <=5\) //此题默认 —— N1 >= N 阅读全文
posted @ 2020-08-12 16:17 RioTian 阅读(178) 评论(0) 推荐(1)
该文被密码保护。
posted @ 2020-08-12 12:30 RioTian 阅读(16) 评论(0) 推荐(1)
摘要:KMP 与 Sunday的比较 Gate 总结:一般来说使用KMP能保证不出错 ##快读入门 https://www.wjyyy.top/3514.html inline int read() { int s = 0, w = 1; char ch = getchar(); while (ch<'0 阅读全文
posted @ 2020-08-11 21:11 RioTian 阅读(324) 评论(0) 推荐(1)
摘要:Problem Description the second year of the university somebody started a study on the romantic relations between the students. The relation “romantica 阅读全文
posted @ 2020-08-11 21:06 RioTian 阅读(189) 评论(0) 推荐(0)
摘要:题目链接:http://poj.org/problem?id=3565 Description Young naturalist Bill studies ants in school. His ants feed on plant-louses that live on apple trees. 阅读全文
posted @ 2020-08-11 19:55 RioTian 阅读(212) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/1062/D 题目描述 Freda的城堡—— “Freda,城堡外发现了一些入侵者!” “喵...刚刚探究完了城堡建设的方案数,我要歇一会儿嘛lala~” “可是入侵者已经接近城堡了呀!” “别担心,rainbow,你看呢 阅读全文
posted @ 2020-08-11 17:38 RioTian 阅读(198) 评论(0) 推荐(0)

上一页 1 ··· 12 13 14 15 16 17 18 19 20 ··· 25 下一页