![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeup
qq_40034684
这个作者很懒,什么都没留下…
展开
-
100000593 C++- 《算法笔记》——数学问题->大整数运算
#include <cstdio> #include <vector> #include <string.h> #include <algorithm> #include <iostream> using namespace std; bool cmp(string a, string b){ if(a.size()!=b.size()) return a.size() < b.size(); else return a < b;原创 2020-08-07 23:00:39 · 174 阅读 · 0 评论 -
100000581 - c++《算法笔记》4.1小节 排序问题 C: EXCEL排序
没啥说的,注意输出格式就行 #include <cstdio> #include <vector> #include <string.h> #include <algorithm> #include <iostream> using namespace std; struct student{ char name[9]; int xuehao; int chengji; }stu; bool cmp1(student a,studen原创 2020-08-07 15:20:28 · 79 阅读 · 0 评论 -
codeup 100000591 - 《算法笔记》5.4小节——数学问题->素数
用埃氏筛选将10000内的尾数为1的素数保存在数组中,按要求输出。 #include <cstdio> #include <vector> #include <algorithm> #include <math.h> using namespace std; int hashtable[10001]={1}; int main(){ int a, n, mark=0; vector<int> primes; fill(hashtable原创 2020-08-06 21:04:58 · 126 阅读 · 0 评论 -
codeup 100000589 :c++ Least Common Multiple
ab/c和(right+left)/2 的正整数运算最好写成 a/cb 和 (right-left)/2+left避免溢出出错。 #include <cstdio> #include <vector> #include <algorithm> using namespace std; int gongyueshu(int a, int b){ int d = 0; if(b == 0) return a; else { d=gongyueshu(b,a%b);原创 2020-08-05 16:46:55 · 99 阅读 · 0 评论 -
codeup 100000600: C语言-数字交换
这道题早晨解决时候卡死在答案只能正确百份之五十,午觉醒来举出反例,想到了还有百分之五十如何解决。 错误的代码也被注释保留。原创 2020-08-04 16:24:17 · 103 阅读 · 0 评论 -
codeup 100000597: Set Similarity
使用c++的解题代码如下 #include <cstdio> #include <string.h> #include <stdlib.h> #include <set> using namespace std; int main(){ int n = 0, m=0, x = 0; double cnt = 0; int i = 0, j=0, k=0; scanf("%d", &n); set< int >zu[60];原创 2020-08-03 22:15:10 · 91 阅读 · 0 评论 -
codeup 问题 B: Student List for Course 作业比赛编号 : 100000596
c++解题代码 #include <cstdio> #include <cstdlib> #include <string.h> #include <vector> #include <algorithm> using namespace std; char table[27]="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int hashtable[2501]={false}; //hash表记录需要打印出的课程的课程编号 v原创 2020-08-03 11:28:56 · 166 阅读 · 0 评论