首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
cc12345
这个人很懒,什么都没有写...
关注
发消息
文章
0
题解
28
发帖
0
笔记
0
Ta的粉丝
0
关注数
0
粉丝数
0
获赞数
98
阅读数
3590
判断素数 题解:<=sqrt平方根进行%判断
#include<bits/stdc++.h> using namespace std; bool isPrime(int n) { if(n<2) return false; for(int i=2;i<=sqrt(n);i++) { if...
P1013
2025年3月20日 22:15
回复 0
|
赞 5
|
浏览 105
字符串翻转 题解:由于不会reverse,故采用swap交换位置
#include<bits/stdc++.h> using namespace std; int main() { string s; cin>>s; int low=0; int high=s.length()-1; while(low<hi...
P1006
2025年3月20日 18:26
回复 0
|
赞 3
|
浏览 143
上楼梯 题解:理解动态规划
#include<bits/stdc++.h> using namespace std; int main(){ int n; int dp[21]; dp[1]=1; dp[2]=2; dp[3]=4; for(int i=4;i<=20;i++) ...
P1658
2025年3月20日 17:18
回复 0
|
赞 2
|
浏览 53
喝饮料 题解:记得第二次循环后清除数据
#include <bits/stdc++.h> using namespace std; struct node{ float milk; float widget; float danjia; //单价 }; bool cmp(node a,node b)...
P1478
2025年3月19日 21:17
回复 0
|
赞 5
|
浏览 112
斐波那契数列 题解:找好数列规律
#include<bits/stdc++.h> using namespace std; int main() { long long nums[72]={0,1,1}; for(int i=3;i<=72;i++) { nums[i]=nums[i...
P1111
2025年3月19日 16:41
回复 0
|
赞 11
|
浏览 249
ISBN号码识别 题解:刚开始给你带ISBN编码可能最后一位为X要进行判断。
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int n=9; int total=0; total=(s[0]-'0')*1+...
P2000
2025年3月19日 16:00
回复 0
|
赞 0
|
浏览 73
ISBN号码识别 题解:刚开始给你带ISBN编码可能最后一位为X要进行判断。
#include<bits/stdc++.h> using namespace std; int main(){ string s; cin>>s; int n=9; int total=0; total=(s[0]-'0')*1+...
P2000
2025年3月19日 16:00
回复 0
|
赞 0
|
浏览 76
矩阵位置 题解:暴力
#include<bits/stdc++.h> using namespace std; int main() { int n=3; int nums[3][3]={{1,2,3},{4,5,6},{7,8,9}}; while(n--){ int number;...
P1543
2025年3月19日 14:28
回复 0
|
赞 2
|
浏览 71
怎么借书 题解:关键点:if(i!=j&&j!=k&&i!=k)
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int count=0; for(int i=1;i<=n;i++) { for(int j...
P2004
2025年3月19日 14:12
回复 0
|
赞 0
|
浏览 67
字符游戏 题解:(两种方法)暴力强解法 以及 前后比较法
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; string s; cin>>s; stable_sort(s.begin(),s.end(...
P1520
2025年3月19日 11:20
回复 0
|
赞 2
|
浏览 117
堆排序 题解:采用堆排序后运行66%后超时,后采用队列容器。
#include<bits/stdc++.h> using namespace std; //void Heapsort(int b[],int a){ // for(int i=a;i>=1;i--) //{ // for(int j=i;j>1;j--...
P2012
2025年3月19日 10:26
回复 0
|
赞 2
|
浏览 99
查找第K小数 题解:
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; //n个数据 vector<int> num(n); for(int i=0;i<n;i...
P1383
2025年3月18日 22:52
回复 0
|
赞 3
|
浏览 155
成绩排序 题解:暴力冒泡排序,但只有66%后超时
#include <bits/stdc++.h> using namespace std; // 定义学生结构体 struct Student { string name; // 学生姓名 int score; // 学生分数 }; ...
P1151
2025年3月17日 11:30
回复 1
|
赞 5
|
浏览 169
动态查找问题 题解:注意没有的话要加入其中
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int num[100000]; for(int i=0;i<n;i++){ cin>>...
P1477
2025年3月18日 09:41
回复 0
|
赞 3
|
浏览 126
这是第几天? 题解:如下
#include<bits/stdc++.h> #include<stdio.h> using namespace std; int run(int year){ if((year%4==0&&year%100!=0)||year%400==...
P1542
2025年3月18日 09:22
回复 0
|
赞 2
|
浏览 126
查找学生信息2 题解:使用flag来判断是否存在;记住类型用string
#include<bits/stdc++.h> using namespace std; struct student{ string number; string name; string sex; string age; }; int main() { ...
P1476
2025年3月18日 00:30
回复 0
|
赞 1
|
浏览 126
求最大连续公共字串长度 题解:用scanf代替cin后,运行数据从90%到100%
#include <bits/stdc++.h> using namespace std; #include<stdio.h> int main() { char s1[1000], s2[1000]; scanf("%s %s",&a...
P1875
2025年3月17日 21:51
回复 0
|
赞 16
|
浏览 275
车厢重组 题解:冒泡排序
#include<bits/stdc++.h> using namespace std; int main() { int count; cin>>count; int num[count]; int number=0; for(int i=0;i&...
P1060
2025年3月17日 20:24
回复 0
|
赞 5
|
浏览 127
整数奇偶排序 题解:先暴力分区,然后找到分区点后排序
#include<bits/stdc++.h> using namespace std; bool cmp_desc(int a,int b) { return a>b; } int main() { int a[10]; while(cin>&...
P1248
2025年3月17日 20:04
回复 0
|
赞 0
|
浏览 76
字符值 题解:
4. 性能 CIN 中: 由于 是 C++ 标准库的一部分,通常会与 同步,导致性能较低。cincout 可以通过 关闭同步,提高性能(接近 &...
P1870
2025年3月17日 19:38
回复 0
|
赞 2
|
浏览 105
1
2
本科学校:昆明学院
目标学校:云南大学
点此申请N诺身份认证
获得 noobdream 认证,享受多重认证福利!