随笔分类 -  算法

学习算法
摘要:#include <iostream> #include <map> #include <stack> #include <string> using namespace std; map<char,int> priorityIn{ {'+',3}, {'-',3}, {'*',5}, {'/',5 阅读全文
posted @ 2020-10-19 15:23 Joey_blog 阅读(92) 评论(0) 推荐(0)
摘要:11年408真题,pdf上给的参考答案竟然是错的,自己调了一遍 #include <stdio.h> #include <stdlib.h> int Search(int A[],int B[],int n); int main() { int a[5] = {3,12,13,14,15}; int 阅读全文
posted @ 2020-10-09 19:56 Joey_blog 阅读(177) 评论(0) 推荐(0)
摘要:/* 试题编号:201912-2 试题名称:回收站选址 题目描述: 通过无人机航拍我们已经知晓了n处尚待清理的垃圾位置,其中第i(1<=i<=n)处的坐标为(xi,yi),保证所有的坐标均为整数。 我们希望在垃圾集中的地方建立些回收站。具体来说,对于一个位置(x,y)是否适合建立回收站,我们主要考虑 阅读全文
posted @ 2020-02-09 10:28 Joey_blog 阅读(671) 评论(0) 推荐(0)
摘要:样例全部没问题,但是只有40分,不知道哪里出问题了: #include <iostream> #include <string> #include <map> #include <sstream> using namespace std; class Fomular { private: strin 阅读全文
posted @ 2020-02-03 14:42 Joey_blog 阅读(766) 评论(0) 推荐(0)
摘要:试题编号: 201312-1试题名称: 出现次数最多的数问题描述 给定n个正整数,找出它们中出现次数最多的数。如果这样的数有多个,请输出其中最小的一个。输入格式 输入的第一行只有一个正整数n(1 ≤ n ≤ 1000),表示数字的个数。 输入的第二行有n个整数s1, s2, …, sn (1 ≤ s 阅读全文
posted @ 2019-12-15 22:55 Joey_blog 阅读(1658) 评论(0) 推荐(0)