上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页
摘要: 题目 代码 1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 int ISYEAP(int x){ 6 if((x%100!=0 && x % 4 == 0) || (x % 400 == 0) )return 阅读全文
posted @ 2021-03-02 17:40 Uitachi 阅读(64) 评论(0) 推荐(0)
摘要: 题目 2008年上海交大计算机上机题 代码 1 #include<iostream> 2 #include<algorithm> 3 #include<cstring> 4 using namespace std; 5 6 int ISYEAP(int x){ 7 if((x%100!=0 && x 阅读全文
posted @ 2021-03-02 17:23 Uitachi 阅读(132) 评论(0) 推荐(0)
摘要: 题目 日期类的题目基本都要找一个起点,提前预处理 代码 1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 //判断是否是闰年或平年 5 int ISYEAP(int x){ 6 if((x %100 != 0 && 阅读全文
posted @ 2021-03-01 21:42 Uitachi 阅读(67) 评论(0) 推荐(0)
摘要: 题目 代码 1 #include<iostream> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int main(){ 6 char str[201]; 7 cin>>str; 8 int n = strle 阅读全文
posted @ 2021-03-01 20:17 Uitachi 阅读(55) 评论(0) 推荐(0)
摘要: 题目 代码 1 #include<iostream> 2 #include<algorithm> 3 #include<string.h> 4 using namespace std; 5 typedef struct stu{ 6 char cno[10]; 7 char name[10]; 8 阅读全文
posted @ 2021-03-01 18:37 Uitachi 阅读(84) 评论(0) 推荐(0)
摘要: 题目 输入一系列整数,将其中最大的数挑出(如果有多个,则挑出一个即可),并将剩下的数进行排序,如果无剩余的数,则输出-1。 代码 1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 int main(){ 5 int 阅读全文
posted @ 2021-03-01 17:11 Uitachi 阅读(85) 评论(0) 推荐(0)
摘要: 题目 成绩排序——2000年清华大学计算机机试真题 代码 1 #include<iostream> 2 #include<algorithm> 3 #include<string> 4 using namespace std; 5 typedef struct stu{ 6 char name[10 阅读全文
posted @ 2021-03-01 16:50 Uitachi 阅读(70) 评论(0) 推荐(0)
摘要: 冒泡排序 1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 int n; 5 int main(){ 6 int a[100]; 7 while(scanf("%d",&n) != EOF){ 8 for(int 阅读全文
posted @ 2021-03-01 16:13 Uitachi 阅读(45) 评论(0) 推荐(0)
摘要: 题目 分析 自己想着dp,结果比赛一直卡住。今天看y总直播又学习到了。本题直接暴力搜索就可,用四进制搜。从40——4m减1,并且要排除掉每一位上3的可能。简而言之,就是将一个配料方案看成一个m位的四进制数 代码 1 class Solution { 2 public: 3 int closestCo 阅读全文
posted @ 2021-02-28 17:09 Uitachi 阅读(92) 评论(0) 推荐(0)
摘要: 题目 LeetCode102.二叉树的层序遍历 代码 1 class Solution { 2 public: 3 4 vector<vector<int>>ans; 5 vector<vector<int>> levelOrder(TreeNode* root) { 6 if(root == NU 阅读全文
posted @ 2021-02-24 21:03 Uitachi 阅读(184) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 19 下一页