无语,这种水题还出,浪费时间,但又不得不A... #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #define SICKLE 17 #define KNUT 29 using namespace std; int a1,a2,a3; int b1,b2,b3; int main() { scanf(&q…
1058 A+B in Hogwarts (20 分)   If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enou…
1058 A+B in Hogwarts (20分) 题目: If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy eno…
排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询,建立id与索引的映射即可. #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <map> using namespace s…
和1024一样都是大数据的题,因为位数最多要20位,long long最多19位给一个num,求sum=num+num问sum包含的数字,是否是num的一个排列,即数字都一样,只是顺序不同罢了. #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <string> using namespace std; ; struct…
水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> using namespace std; /* 太水水水... */ +; int cnt1,cnt2,cnt3,cnt4; struct Node{ int id; int tot; int vir; int tal; bool operator<(const Node t…
贪心水题,每次取最短的两个绳子合并,长度缩减成一半 #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <string> #include <map> using namespace std; +; int a[maxn]; int main() { int n; scanf("%d",&am…
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> using namespace std; int n; int n1,n2,n3; ]; int main() { scanf("%s",str); n=strlen(str); n1=n3=(n+)/; n2=n+-n1-n3; //p…
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h> using namespace std; /* 对于第i个数字(i=0~n-1),它每组出现的次数为n-i,出现在前i+1个组中 */ +; double num[maxn]; int main() { int n; scanf("%d",&n); double sum=0.…
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #include<queue> #include<algorithm> using namespace std; int a1,b1,c1; int a2,b2,c2; int ans1,ans2,ans3; int main() { scanf("%d.%d.%d",&…
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough." Your job is to write…
题意: 输入两组,每组三个非负整数A,B,C(A<=1e7,B<17,C<29),输出相加的和.(类似个位上29进制,十位上17进制运算) AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC #include<bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int a…
#include <stdio.h> int main() { ]; ]; ],&ans1[],&ans1[],&ans2[],&ans2[],&ans2[])!=EOF) { ans1[]+=ans2[]; ans1[]+=ans2[]; ans1[]+=ans2[]; ans1[]+=ans1[]/; ans1[]=ans1[]%; ans1[]+=ans1[]/; ans1[]=ans1[]%; printf(],ans1[],ans1[]); }…
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough." Your job is to write…
准备每天刷两题PAT真题.(一句话题解) 1001 A+B Format  模拟输出,注意格式 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; string ans = ""; int main() { ; cin >> a >> b; c = a + b; ) {…
快速排序有一个特点,就是在排序过程中,我们会从序列找一个pivot,它前面的都小于它,它后面的都大于它.题目给你n个数的序列,让你找出适合这个序列的pivot有多少个并且输出来. 大水题,正循环和倒着循环一次,统计出代码中的minnum和maxnum即可,注意最后一定要输出'\n',不然第三个测试会显示PE,格式错误. #include <iostream> #include <cstdio> #include <algorithm> #include <map&…
如题,大水题...贴个代码完事,就这么任性~~ #include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #define INF 0x3f3f3f3f using namespace std; /* 求满足下面的最大的E: 恰好有E个天的行程都大于E miles 从小到大排序,倒着循环一遍,直到最小值<=天数为止,此时的天数-1即为答案. */ +; i…
NOIP2018初赛普及组原题&题解 目录 NOIP2018初赛普及组原题&题解 原题&答案 题解 单项选择题 第$1$题 第$2$题 第$3$题 第$4$题 第$5$题 第$6$题 第$7$题 第$8$题 第$9$题 第$10$题 第$11$题 第$12$题 第$13$题 第$14$题 第$15$题 问题求解 第$1$题 第$2$题 阅读程序写结果 第$1$题 第$2$题 第$3$题 第$4$题 完善程序 第$1$题 第$2$题 原题&答案 普及组C++语言试题: 普及组…
啊啊啊啊啊啊今天已经星期三了吗 那么,来一波题解吧 本题地址http://www.luogu.org/problem/show?pid=1006 传纸条 题目描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题.一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了.幸运的是,他们可以通过传纸条来进行交流.纸条要经由许多同学传到对方手里,小渊坐在矩阵的左上角,坐标(1,1),小轩坐在矩阵的右下角,坐标(m,n).从小渊…
51nod图论题解(4级,5级算法题) 1805 小树 基准时间限制:1.5 秒 空间限制:131072 KB 分值: 80 难度:5级算法题 她发现她的树的点上都有一个标号(从1到n),这些树都在空中飘浮不在土地上生根,然而每天她的这些树会变化一个形态,这使得她很恼火,她想弄清楚到底有多少种形态. 特殊的是这些树的叶子(度数为1)数目是不变的. 由于数目可能很大,她只要它模(1,000,000,007)就可以了. n=3,m=2时有3种方案:1-2-3, 2-3-1,3-1-2. 3-1-2和…
 目录: K Airdrop I Soldier Game L Sub-cycle Graph G Repair the Artwork ———————————————————— ps:楼主脑残有点严重,很容易写错别字和语言组织混乱,如果在读文章时遇到,可以在评论区里回复一下,我好改(花式骗评论) 补题地址:http://acm.zju.edu.cn/onlinejudge/showProblems.do?contestId=1&pageNumber=31 顺便好人做到底,给大家凑个11/13的…
感谢@guz 顾z的题题解 考试共三道题,其中 第一题help共10个测试点,时间限制为 1000ms,空间限制为 256MB. 第二题escape共20个测试点,时间限制为1000ms2000ms,空间限制1MB16MB. 第三题cure共20个测试点,时间限制为 1000ms,空间限制为 256MB. PS:题目背景与题目本身无关,可跳过 help 题目背景 在梦中,王 小 呆 到了一个神秘的地方.这里是昆虫王国!国王见王 小 呆 好生俊俏,便给了他一杯昆虫国的老白干.王 小 呆一口下肚,突…
[ZROI 537]贪心题 题解 Link Solution 最大的一边直接放到一起贪心即可 着重讲小的一边 已知对于二分图匹配,其答案即为最大流 令时间集合为 \(T = {1,2,3,\dots,maxt}\) 对于每一门课程,按照如下方式建图: 每个任务为一个点,每个时间为一个点,每个任务向其对应的时间区间连边,源点向每个任务连边,边权为 \(1\),每个时间向汇点连边,边权为 \(1\) 考虑第一门课程: 我们选择一些时间节点分给它,设为 \(T_1\) 假设最大流中任务集合为 \(A\…
看大佬做2017-WF,我这种菜鸡,只能刷刷水题,勉强维持生活. 赛后补补水题. 题目pdf链接,中文的,tls翻译的,链接在这里 个人喜欢在vjudge上面刷题. E Need for Speed 题意: 有中文题意,我就不多说了,仪表盘会有一个固定偏差,求这个. 思路: 二分答案,进行判断,二分的上下限,我是 -1 到 1e8:一开始范围错了WA掉了. #include <stdio.h> #include <iostream> #include <algorithm&g…
这四道题来自 13 年 08 月 30 的 PAT 测试. 代码量不大,思路也比较直接.不过第一题的处理逻辑不太清晰,需要好好把握.稍有不慎就掉进坑里了(很多人被这道 20'的题坑了一个多小时心慌意乱我会乱说-,-?). PAT advanced level 全部源码:请戳 1061. Dating (20) 题意 题意比较模糊,需要仔细对照 Sample 的数据理清思路.给定四个字符串,每个不超过 60 个字符,不含空格.要求从中找到符合如下规定的三个字符(或者它们的位置),并转化成一个时间的…
答疑帖: 赞助团队:UMR IT Team和洛谷大佬栖息地 赛后题解:更新了那两道练手题的题解 赛时公告,不过一些通知也可能在团队宣言里发出 如果各位发现重题,请将你认为重复的题目链接连同这次比赛的题号一起发到@洛谷万岁 的私信,可能考虑有检举奖励QAQ 下面让我们请出@Forward_Star大佬! 好吧他可能会不在,有些问题我解决吧QAQ 但他应该马上就能回来. 最后祝大家AK愉快! 部分内容出自:https://www.luogu.org/blog/user21760/xiao-man-d…
2018 铺设道路 差分水题,推一下结论就好了. #include<cstdio> #include<algorithm> using namespace std; ],d[],ansz,ansf; int main() { int n; scanf("%d",&n); ;i<=n;i++) scanf(]; ;i<=n;i++) { ) ansf-=d[i]; else ansz+=d[i]; } printf("%d\n&quo…
这场比赛的出题人挺有意思,全部magic成了青色. 还有题目中的图片特别有趣. 晚上没打,开virtual contest打的,就会前三道,我太菜了. 最后看着题解补了第四道. 比赛传送门 A. Angry Students 题目大意:有t队学生,每个学生有两种状态,生气(A)或不生气(P).(话说为什么生气的戴着圣诞帽哇)所有生气的人都会往前一个人丢雪球,被丢到的人也会变得生气,也会丢雪球.问你每队人中最后一个学生变得生气的时刻. 这题就是统计最长的连续的'P'当然前提是左边有生气的人. 代码…
Hello,2020!新的一年从快乐的掉分开始…… 我在m3.codeforces.com这个镜像网站中一开始还打不开D题,我…… 还有话说今天这场为什么那么多二分. 比赛传送门:https://codeforces.com/contest/1284. A. New Year and Naming 题目大意:这题就是一个干支纪年法.每年的名字分两段,第一段在n个字符串中取,第二段在m个字符串中取,每过一年就各取下一个,如果取到n(m)就去取第一个. 纯模拟,加上一点点字符串操作. 又丑又长的代码…
这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:https://codeforces.com/contest/1080. A.Petya and Origami 题意:Petya要发出n张邀请函,每张请函需要2张红纸,5张绿纸,8张蓝纸.现在商店里有一些不同颜色的笔记本,每本中有k张颜色相同的纸,求最少要买几本笔记本. 这题就是一道模拟题,算出每种…