主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1176
十进制和二进制 50%通过率,有大佬可以帮忙看看吗
等等
回复 2
|
赞 0
|
浏览 205
#include<bits/stdc++.h> using namespace std; int main() { char a[200],buf[200]; int b[200]; &n...
P1333
开门人和关门人 题解:
mshj
回复 0
|
赞 0
|
浏览 110
#include<iostream> #include<algorithm> using namespace std; int main() { int n; while (cin >&g...
P2021
整数去重 题解:
sleepysilipu
回复 1
|
赞 0
|
浏览 108
一个暴力解,时间复杂度过高故通过不了评测。 思路:双重for循环,重复项标记为-1 #include<stdio.h> int main(){ int n,i,j; scanf(&...
P1563
迷宫 题解:AC
为欢几何
回复 2
|
赞 0
|
浏览 152
//迷宫问题求起点到终点的最短路径(自己写的代码) #include<bits/stdc++.h> using namespace std; struct node { int x; int y; &nbs...
P1082
Hanoi塔问题 题解:注意输出格式,相邻输出之间有3个空格
为欢几何
回复 0
|
赞 0
|
浏览 96
//汉诺塔输出每一个步骤,五个一换行 #include<bits/stdc++.h> using namespace std; int step;//记录移动步数 void Hanoi(int n, char a, char b, char c) { ...
P1417
八进制 题解:
Amberqwe
回复 2
|
赞 0
|
浏览 211
只有80%,为什么啊 #include<stdio.h> int main() { int n,x; int a[1000000]; int m=0; &nb...
P1562
哈夫曼编码 题解:通过率50%,哪种情况没考虑到呢?
为欢几何
回复 2
|
赞 0
|
浏览 113
//输出字符串最佳无前缀可变长度编码的位长度 #include<bits/stdc++.h> using namespace std; int main() { string s; while(cin >&...
P996
二叉搜索树 - 复旦2020 题解:Time Limit Exceeded 90
为欢几何
回复 3
|
赞 0
|
浏览 165
#include<bits/stdc++.h> using namespace std; int temp[100001]; struct Tree { int data; struct Tree* lchild; struct Tree* ...
P5131
多种排序 题解:
Qweas
回复 0
|
赞 0
|
浏览 84
#include <iostream> #include <vector> #include <algorithm> // 直接插入排序 void insertionSort(std::vector<int>& arr) ...
P1382
哈夫曼树 题解:最简单易懂的思路,AC
为欢几何
回复 2
|
赞 0
|
浏览 167
//哈夫曼树,输出所有结点的值与权值的乘积之和 #include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n) { int ...
P1221
旋转矩阵 题解:
yangke
回复 0
|
赞 0
|
浏览 110
#include <iostream> #include <algorithm> using namespace std; int n, m, k; int manu; int res[101][101]; int a[101][101]; int mai...
P1047
分数求和 题解:规律就是a是a+b,b是上一次的a,注意要用double或者fl
RingoCrystal
回复 0
|
赞 0
|
浏览 110
#include <bits/stdc++.h> using namespace std; double sumAns(int N) { double sum = 0; double a = 2, b = 1; // 初始的前两项 for ...
P1031
判断是否是整数 题解:3.000算整数
RingoCrystal
回复 0
|
赞 0
|
浏览 104
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int flag=0; int tag=0; for(int i=...
P1045
平方和与倒数和 题解:如何获得float,很简单1.0/i
RingoCrystal
回复 0
|
赞 0
|
浏览 107
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; float ansa=0; for(int i=1;...
P1044
阶乘和 题解:考虑到数据的容量,使用longlong改写n!即可
RingoCrystal
回复 0
|
赞 0
|
浏览 112
#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",...
P1685
爬楼梯游戏 题解:C语言解法
快乐小土狗
回复 0
|
赞 0
|
浏览 112
#include <stdio.h> int mod=1e9+7; int dp[1000005];//要先填充dp再进行多组输入,否则会超时 int main() { int n; dp[0]=1,dp[1]=1; for(int i=2;i<=...
P2009
温度转换计算 题解:
G517
回复 0
|
赞 0
|
浏览 122
很基础的一道 #include <stdio.h> int main(void) { double celsius; double fahrenheit; scanf("%lf", &fahrenheit); ...
P1410
打印日期 题解:遍历题,注意break,不break在输入2000 31的时候会
RingoCrystal
回复 0
|
赞 0
|
浏览 100
这种题的本质就是单纯的顺序检索题,这个代码还可以优化,就是不用day,直接在else情况下break,此时输出为year,month,n,注意输出的格式 #include <bits/stdc++.h> using namespace std; int...
P1248
快排划分思想来进行奇偶排序
sincerely_LM
回复 1
|
赞 2
|
浏览 9.4k
#include <iostream> #include <algorithm> using namespace std; bool Compare(const int &a,const int &b){ return a >...
P1290
从小甲鱼那里学了一个很妙的解法
鹅鹅
回复 1
|
赞 3
|
浏览 5.6k
非常简洁非常妙 让y1m1d1的日期逐渐靠近目标日期 #include<stdio.h> int main() { int month[13]= {31,28,31,30,31,30,31,31,30,31,30,31}; int c...
P1022
删除最大最小数 题解:复制数组得到最大最小,核心是解决只删除一个的问题
RingoCrystal
回复 0
|
赞 0
|
浏览 94
#include <bits/stdc++.h> using namespace std; int main(){ int n,x; cin>>n; vector<int> a; vector<int> copy; ...
P1394
统计单词 题解:测试用例只有一个坑,别的很基本
RingoCrystal
回复 0
|
赞 0
|
浏览 99
#include <bits/stdc++.h> using namespace std; int main(){ string s; vector<string> sheet; while(cin>>s){ sheet.pus...
P1161
二叉树遍历 题解:纯C语言版
王自知
回复 0
|
赞 0
|
浏览 92
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct TreeNode{ char data; ...
P1020
最长连续因子 题解:利用数组存储因子,然后检查,更新出来结果
RingoCrystal
回复 0
|
赞 0
|
浏览 107
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int sheet[11000]={0}; int size=0; for(int i=2;...
P1019
字母频率 题解:想问一下有没有大佬知道,为什么加了while就只能过66%
RingoCrystal
回复 2
|
赞 0
|
浏览 141
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ for(int i=0;i<s.size();i++){ i...
P1015
单链表 题解:你怎么知道我next节点全是nullptr
RingoCrystal
回复 0
|
赞 0
|
浏览 95
#include <bits/stdc++.h> using namespace std; struct Node { int Element; // 节点中的元素为整数类型 struct Node * Next; // 指向下一个节点 }; ...
P1543
矩阵位置 题解:
潇风青禾
回复 0
|
赞 0
|
浏览 89
#include<bits/stdc++.h> using namespace std; int main(){ int n; int row; int col; while(cin >> n){ if(n%3==0) row = n ...
P1002
数字统计 题解:转string暴力破
RingoCrystal
回复 0
|
赞 0
|
浏览 83
#include <bits/stdc++.h> using namespace std; int main(){ int l,r; while(cin>>l>>r){ int ans=0; for(int i=l;i<...
P1317
二叉搜索树 题解:AC,建立二叉搜索树以及比较两个二叉树是否相同
为欢几何
回复 0
|
赞 0
|
浏览 121
//判断不同的输入序列是否能组成相同的二叉搜索树 #include<bits/stdc++.h> using namespace std; struct Tree { int data; struct Tree* l...
P1296
正向匹配+反向匹配
心的一方
回复 1
|
赞 2
|
浏览 7.3k
括号匹配的思路就是左括号入栈,右括号的时候若栈里有元素就出栈匹配,最后若栈里还有左括号就匹配失败。按照这道题的话就是没有元素的时候就变成?,但是有一个问题就是栈里多余的左括号怎么变成$对应相应的位置呢????若是使用符号标记的话,例如"(()"与"()("...
1
2
3
4
5
...
126
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇