主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
讨论区
兑换中心
登录
注册
上岸
RingoCrystal
我是菜逼
关注
发消息
文章
0
题解
119
发帖
0
笔记
49
Ta的粉丝
68
关注数
0
粉丝数
68
获赞数
90
阅读数
19872
回文数的判断 题解:reverseInt方法
#include <bits/stdc++.h> using namespace std; int reverseInt(int x){ int ans=0; while(x!=0){ ans*=10; ans+=...
P3501
2025年1月26日 15:15
回复 0
|
赞 0
|
浏览 130
约瑟夫问题的实现 题解:Vector向量解法
这里根据本题,提供两个约瑟夫问题的题解,我们依靠动态链接库里面的向量辅助处理,方便的处理中间的的元素的删除,当然,如果你的学校不支持这个,我建议你采用循环链表,标记0位置即可达到同样的目的 此段代码为题解,n为数量,m为步数 #include <bits/stdc++...
P5104
2025年1月26日 15:05
回复 0
|
赞 1
|
浏览 143
车厢的重组 题解:
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n) { int a[n]; for(int i=0; i<n; i++)ci...
P5132
2025年1月23日 19:23
回复 0
|
赞 0
|
浏览 167
上升序列 题解:
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n],b[n]; for(int i=0;i<n;i++){...
P2017
2025年1月23日 19:11
回复 0
|
赞 0
|
浏览 138
分数求和 题解:规律就是a是a+b,b是上一次的a,注意要用double或者float
#include <bits/stdc++.h> using namespace std; double sumAns(int N) { double sum = 0; double a = 2, b = 1; // 初始的前两项 for ...
P1047
2024年4月6日 16:29
回复 0
|
赞 4
|
浏览 723
判断是否是整数 题解:3.000算整数
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int flag=0; int tag=0; for(int i=...
P1031
2024年4月6日 13:15
回复 0
|
赞 0
|
浏览 741
平方和与倒数和 题解:如何获得float,很简单1.0/i
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; float ansa=0; for(int i=1;...
P1045
2024年4月6日 11:33
回复 0
|
赞 0
|
浏览 677
阶乘和 题解:考虑到数据的容量,使用longlong改写n!即可
#include <stdio.h> long long getF(long long a){ if(a==0||a==1)return 1; return a*getF(a-1); } int main(){ int n; scanf("%d",...
P1044
2024年4月6日 11:21
回复 0
|
赞 1
|
浏览 648
打印日期 题解:遍历题,注意break,不break在输入2000 31的时候会错误
这种题的本质就是单纯的顺序检索题,这个代码还可以优化,就是不用day,直接在else情况下break,此时输出为year,month,n,注意输出的格式 #include <bits/stdc++.h> using namespace std; int...
P1410
2024年4月6日 09:54
回复 0
|
赞 1
|
浏览 578
删除最大最小数 题解:复制数组得到最大最小,核心是解决只删除一个的问题
#include <bits/stdc++.h> using namespace std; int main(){ int n,x; cin>>n; vector<int> a; vector<int> copy; ...
P1022
2024年4月5日 09:07
回复 0
|
赞 0
|
浏览 623
统计单词 题解:测试用例只有一个坑,别的很基本
#include <bits/stdc++.h> using namespace std; int main(){ string s; vector<string> sheet; while(cin>>s){ sheet.pus...
P1394
2024年4月5日 08:42
回复 0
|
赞 2
|
浏览 811
最长连续因子 题解:利用数组存储因子,然后检查,更新出来结果
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int sheet[11000]={0}; int size=0; for(int i=2;...
P1020
2024年4月4日 13:44
回复 0
|
赞 0
|
浏览 700
字母频率 题解:想问一下有没有大佬知道,为什么加了while就只能过66%
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ for(int i=0;i<s.size();i++){ i...
P1019
2024年4月3日 15:12
回复 2
|
赞 0
|
浏览 630
单链表 题解:你怎么知道我next节点全是nullptr
#include <bits/stdc++.h> using namespace std; struct Node { int Element; // 节点中的元素为整数类型 struct Node * Next; // 指向下一个节点 }; ...
P1015
2024年4月3日 17:33
回复 0
|
赞 3
|
浏览 668
数字统计 题解:转string暴力破
#include <bits/stdc++.h> using namespace std; int main(){ int l,r; while(cin>>l>>r){ int ans=0; for(int i=l;i<...
P1002
2024年4月3日 09:51
回复 0
|
赞 2
|
浏览 717
01序列 题解:利用bitset
#include <bits/stdc++.h> using namespace std; int main(){ for(int i=0;i<64;i++){ string str=bitset<6>(i).to_string(); ...
P1001
2024年3月31日 11:43
回复 0
|
赞 1
|
浏览 713
喝饮料 题解:每毫升的单价低者先喝
#include <bits/stdc++.h> using namespace std; struct node{ float mi; float wi; float good; node(float a,float b,float c){ mi...
P1478
2024年3月31日 11:20
回复 0
|
赞 0
|
浏览 615
南京理工-括号匹配 题解:map辅助判断
这个解法的本质其实很简单,这里提供一个例子来辅助大家理解 ({[)]为例,首先加入(,第一次判定为不等{加入,之后又不等[加入,)仍然不等加入,此时为({[),这时其实已经很显然了,对于左括号和不能正确匹配的右括号都采用跳过的方式,并不是直接就结束了,最后所以判断是否为空,对于正常的状态...
P1838
2024年3月30日 12:42
回复 0
|
赞 1
|
浏览 692
括号的匹配 题解:想问一下大佬为什么只能过20%
#include <bits/stdc++.h> using namespace std; int level(char a){ int level; if(a=='<')level=1; else if(a=='(')level=2...
P1067
2024年3月30日 11:11
回复 1
|
赞 0
|
浏览 744
1
...
4
5
6
本科学校:中国药科大学
目标学校:河南大学
点此申请N诺身份认证
获得 noobdream 认证,享受多重认证福利!