摘要: 逻辑问题,对我来说还是挺有难度的,一开始想不通 我输入数据并以数据为下标,数据出现次数为内容存储 然后从后遍历计算所有大于当前下标的元素出现的次数 最后遍历一遍确定是否为爱丁顿数,如果大于当前已经找到的就替换,最后输出最大值 include include using namespace std; 阅读全文
posted @ 2018-08-18 07:25 路明天 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 简单逻辑题, include include using namespace std; int main(){ int N,M;//输入在第一行给出两个不超过 100 的正整数 N 和 M,分别是学生人数和判断题数量 scanf("%d%d",&N,&M); int score[M],ans[M]; 阅读全文
posted @ 2018-08-18 07:21 路明天 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 如果了解分数运算,本题很简单。我有对分数知识进行总结 "分数四则运算" include include using namespace std; int gongyue(int a,int b){ return !b?a:gongyue(b,a%b); } struct fenshu{ int fe 阅读全文
posted @ 2018-08-18 07:19 路明天 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 水题,没有难点 阅读全文
posted @ 2018-08-18 07:16 路明天 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 以前写的,逻辑不好,过后再改 include include include using namespace std; bool cmp(int a,int b){ return a 阅读全文
posted @ 2018-08-18 07:14 路明天 阅读(257) 评论(0) 推荐(0) 编辑
摘要: ``` include include include using namespace std; int canzhao[100000],canzhao2[100000],laike[10005]; //分别存储谁是谁的配偶,标记这个来客的配偶已经来了,来的客人 bool cmp(int a,int 阅读全文
posted @ 2018-08-18 07:05 路明天 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 注意输出是占三位,其他的挺水 include include using namespace std; int main(){ int M,N;scanf("%d %d",&M,&N); int A,B;scanf("%d %d",&A,&B); int hui;scanf("%d",&hui); 阅读全文
posted @ 2018-08-18 06:59 路明天 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 注意读取时的换行符用getchar吸收 第十个错误后直接输出锁定 阅读全文
posted @ 2018-08-18 06:56 路明天 阅读(594) 评论(2) 推荐(0) 编辑
摘要: 一开始因为看见这题就头疼,可费了点时间。 要考虑所有元素,如果忽略外圈元素,最后一个样例过不去。 而且要求只出现一次的元素, 我没有使用map,因为当时还没学,用map储存元素会节约好多代码 include include int M,N,TOL; int arr[1001][1001]; int 阅读全文
posted @ 2018-08-18 06:52 路明天 阅读(410) 评论(0) 推荐(0) 编辑
摘要: 一开始并没有做出来,关键是没有认真理解题,每次做题之前都应该认真读题,自己把样例模拟一下,防止漏掉信息,减慢自己写代码的速度 此题的重点在于规划逻辑,以及如何储存中奖者,用map最好,否则查找并不方便, include include include include using namespace 阅读全文
posted @ 2018-08-18 06:48 路明天 阅读(558) 评论(0) 推荐(0) 编辑