主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1736
求30的倍数 题解:C++全排列函数
huanghu
回复 0
|
赞 0
|
浏览 160
#include <iostream> #include <vector> #include<string> #include<algorithm> using namespace std; int main(){ st...
P1025
链表合并 题解:
1576684866
回复 0
|
赞 0
|
浏览 239
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> typedef struct node...
P1017
快速幂 题解:
01Zen
回复 0
|
赞 0
|
浏览 257
# 快速幂 #include<cstdio> #include<iostream> using namespace std; int main(){ long long m,n; &...
P1052
学生成绩管理 题解:C++
huanghu
回复 0
|
赞 0
|
浏览 103
#include <iostream> #include<string> using namespace std; struct student{ string id; string banji; string name; float sc...
P1051
日期计算 题解:直接计算即可
acd131415
回复 0
|
赞 0
|
浏览 133
#include<iostream> using namespace std; int main(){ int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};  ...
P1382
哈夫曼树 题解:c++ priority_queue实现
Cookie‘s AE86
回复 0
|
赞 0
|
浏览 166
#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n){ &n...
P1397
字符串连接 题解:
泛泛之交
回复 0
|
赞 0
|
浏览 101
#include <bits/stdc++.h> using namespace std; int main() { char s[101]; string a; &n...
P1020
最长连续因子 题解:不用数组,我感觉还是好理解的
我爱陈少熙
回复 2
|
赞 1
|
浏览 538
#include<stdio.h> #include<stdlib.h> int main() { int n,max=0,m=0,k,km;//k存放因子,km存放连续因子中最大的那个 scanf("%d",&...
P1151
成绩排序 题解:求大佬看看为什么正确率只有50阿
韩诺初
回复 1
|
赞 0
|
浏览 274
#include<stdio.h> struct student{ char name[100]; int score; }; int main(){ st...
P1825
相隔天数 题解:
Estra
回复 0
|
赞 0
|
浏览 124
#include <stdio.h> using namespace std; int abs(int n){ if(n>=0){ return n;...
P1067
括号的匹配 题解:c++ stl中的stack容器和map容器实现。
Cookie‘s AE86
回复 0
|
赞 0
|
浏览 207
#include<bits/stdc++.h> using namespace std; //设置括弧的优先级 map<char,int> bkPriority = { {'<', 0}, {'(', 1}, {'[', 2}, {'{',...
P1067
括号的匹配 题解:用的stl中的stack,总是报错Process termin
Cookie‘s AE86
回复 2
|
赞 0
|
浏览 192
#include<bits/stdc++.h> using namespace std; //设置括弧的优先级 map<char,int> bkPriority = { {'<', 0}, {'(', 1}, {'[', 2}, {'{',...
P1832
字符串的差 题解:删除a中重复后进行字符串移动 已更新100% a中字符删除后直
中国人民万岁
回复 2
|
赞 0
|
浏览 147
#include <bits/stdc++.h> using namespace std; int main() { string a, b; getline(cin, a); &...
P1661
惠民工程 题解:克鲁斯卡尔的板子,已改正100%
中国人民万岁
回复 2
|
赞 0
|
浏览 175
#include <bits/stdc++.h> using namespace std; const int M = 105; int fa[M]; int find(int x) { if (x == fa[x]) { ...
P1020
最长连续因子 题解:
JOURISON
回复 0
|
赞 0
|
浏览 156
两个数组搞定 1、存储因子a数组 2、存储因子后续最大连续个数b数组 #include<bits/stdc++.h> using namespace std; int main(){ int n; ...
P1019
字母频率 题解:C
williams
回复 0
|
赞 0
|
浏览 253
#include <stdio.h> #include <string.h> #include <ctype.h> int main(){ char s[1000],count[30]; for(int i=0;i<30;i++)...
P1446
日期累加 题解:成功AC,注意下年份增加了,要重新判断平闰年
渐鸿于陆
回复 0
|
赞 0
|
浏览 224
#include<stdio.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(void){ int m; ...
P1475
你说得对,但这就是面向对象
Kohi
回复 0
|
赞 1
|
浏览 121
#include <iostream> #include <stdio.h> #include <string> #include <string.h> #include <cstring> #include <m...
P1177
查找学生信息 纯C题解:
qq1915133275
回复 0
|
赞 0
|
浏览 284
#include<stdio.h> //两个数组,stu[i]表示学生i喜欢的书号,book[i]表示喜欢书i的人数 注意书号从1-m int main() { int n,m; wh...
P998
打地鼠 题解:贪心
xjnotywlq
回复 0
|
赞 0
|
浏览 149
#include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 100010; int n, d; in...
P1883
达到回文数 题解:
zxd12363
回复 0
|
赞 0
|
浏览 84
#include<bits/stdc++.h> using namespace std; int main() { string s; int count = 0;  ...
P1334
最大连续子序列 题解:动态规划实现
遨游
回复 0
|
赞 0
|
浏览 247
#include <iostream> using namespace std; int main(){ int n; while(cin>>n){ &nbs...
P1437
日期类 题解:成功AC,nice
渐鸿于陆
回复 0
|
赞 0
|
浏览 224
#include<stdio.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(void){ int year,month,day,n; ...
P1377
旋转矩阵 - 北航 题解:注意是多组数据输入,旋转三次还对不上就返回-1
1576684866
回复 0
|
赞 0
|
浏览 286
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> //判断两个矩阵是否相同 bool ...
P1910
Minimum_Sum 题解:
zxd12363
回复 0
|
赞 0
|
浏览 94
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); ...
P1018
击鼓传花 (c用数组实现)题解:
sssmw
回复 0
|
赞 1
|
浏览 273
#include <stdio.h> #include <stdlib.h> #define N 100 int main() { int n,a[N]={0},count,i,k; scanf(&qu...
P1437
日期类 题解:
flipped
回复 0
|
赞 0
|
浏览 211
#include<stdio.h> #include<stdbool.h> bool isL(int year) { if((year%4==0&&year%100!=0)||year%400==0) return true;...
P1284
下次还填非常简单
Kohi
回复 0
|
赞 0
|
浏览 188
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 1; int prime[maxn]; void getPrime(){ memset(prime, 0, s...
P1058
求组合数 题解:c++
huanghu
回复 0
|
赞 0
|
浏览 124
#include <iostream> #include <vector> #include<string> #include<malloc.h> #include<algorithm> #include<math...
P1394
纯纯逆天测试例(‘.'前有可能是空格)
周小黑02477
回复 2
|
赞 2
|
浏览 555
#include<bits/stdc++.h> using namespace std; int main() { string s; while (getline(cin,s)) { int len = s.length(); int cou...
P1254
字符串排序 题解:简简单单
1576684866
回复 0
|
赞 0
|
浏览 209
using namespace std; #include <string.h> #include <algorithm> #include <iostream> int main() { char s[100...
P1017
绝妙精彩!
Kohi
回复 0
|
赞 0
|
浏览 204
#include <bits/stdc++.h> using namespace std; typedef long long int lli; const lli mod = 233333; lli mod_string(string s){ l...
P1159
成绩排序2.0 题解:改了好多次了,一直都通过不了
zsan
回复 1
|
赞 0
|
浏览 213
#include<bits/stdc++.h> using namespace std; struct grade{ int num; int score; }g[105]; bool comp(grade l,g...
P1032
变位词 题解:统计各字母数量
yanmy
回复 0
|
赞 0
|
浏览 162
#include <stdio.h> #include <string.h> int main() { int n; scanf("%d", &n); while (n--) { char a[...
P1001
01序列 题解:
zwl__rank
回复 0
|
赞 0
|
浏览 313
法1:暴力直接六层for循环,不多bb #include<iostream> using namespace std; int main() { int a,b,c,d,e,f; for(a=0;a<2;...
P1417
八进制 题解:
Liinsy
回复 2
|
赞 0
|
浏览 318
为什么vs可以通过家人们? #include<stdio.h> int main() { int n; int a[100]; whi...
P1410
打印日期 题解:C语言题解 多组输入
flipped
回复 0
|
赞 0
|
浏览 170
#include<stdio.h> #include<stdbool.h> bool isL(int year)//判断闰年 { if((year%4==0&&year%100!=0)||year%400==0) return...
P1334
最大连续子序列 题解:[C++]原算法上做改动,仅供参考
Sayuri
回复 0
|
赞 0
|
浏览 204
#include <bits/stdc++.h> using namespace std; int maxSum(int a[], int n, int &bgn, int &ed); int main(in...
P1290
日期差值 题解:
flipped
回复 0
|
赞 0
|
浏览 218
#include <stdio.h> #include<stdbool.h> bool isL(int year)//判断闰年 { if((year%4==0&&year%100!=0)||year%400==0) retur...
P1544
合并果子 题解:c++ priority_queue<int> 实现
Cookie‘s AE86
回复 0
|
赞 0
|
浏览 162
#include<bits/stdc++.h> using namespace std; int main(){ int n; priority_queue<int, vector<int>,...
P1259
进制转换2 题解:
lingdongyang
回复 0
|
赞 0
|
浏览 327
用gets(s)!=NULL只有50%正确率 scanf("%s",s)!=EOF才能100% 第一种 #include<stdio.h> #include<math.h> #include<string.h> ...
P5126
细菌繁殖问题 题解:
望雨天
回复 0
|
赞 0
|
浏览 235
找规律 X=1,num=1 x=2,num=5 x=3, num=13 x=4,num=25 可以得出地推关系式:f(n)=f(n-1)+4*(n-1) #include<iostream> using namespac...
P1011
日期 题解:
flipped
回复 0
|
赞 0
|
浏览 171
#include <stdio.h> int main() { int month,day; scanf("%d",&month); scanf("%d",&day); int days=0; int d[13]={0,0,0,0,30,31...
P5105
集合中的相同元素 题解:
望雨天
回复 0
|
赞 0
|
浏览 111
使用map,因为map自带的去重和排序功能 对两组输入存入map,第一组的second值全为0,第二组的second值全为1 遍历第一组,每次去第二组中判断第一组中的键是否出现,如果出现,count++,并且将second的0置为1,表示出现了。 最后再遍历一遍第一组,输出s...
P1217
国名排序 题解:
1576684866
回复 0
|
赞 0
|
浏览 213
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> int main() {  ...
P1025
链表合并 题解:
lingdongyang
回复 0
|
赞 0
|
浏览 189
尝试不用链表,感觉要简单点 #include<stdio.h> #include<string.h> #include<math.h> int main() { int n1; scanf("%d", &n1); int ...
P1011
日期 题解:成功AC
渐鸿于陆
回复 0
|
赞 0
|
浏览 240
#include<stdio.h> int days[13] = {0,0,0,0,30,31,30,31,31,30,31,30,31}; int count(int month,int day){ int num = 0; &nbs...
P1290
日期差值 题解:
1576684866
回复 0
|
赞 0
|
浏览 156
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; #include <string.h> #include <algorithm> #include <...
P1141
小H的搬寝室 题解:数据量少 可以暴力法
damowanghwj
回复 0
|
赞 0
|
浏览 228
#include<bits/stdc++.h> using namespace std; const int maxn = 1005; int weight[maxn]; int main() { int n, w; while (scanf(&...
P3502
密码的翻译 题解:
望雨天
回复 0
|
赞 0
|
浏览 201
#include<iostream> #include<string> // cout<<(int)'A'<<endl;//65 // cout<<(int...
P3684
n个数的最小公倍数 题解:
望雨天
回复 0
|
赞 0
|
浏览 138
算法思想:从前到后两两求解最小公倍数 求x,y两数的最小公倍数的方法,可以使用c++的库函数__gcd(x,y)先求解出x,y的最大公约数,而最小公倍数=x*y/最大公约数 #include<iostream> #include<algorithm> u...
P1067
括号的匹配 题解:
easymoney
回复 0
|
赞 0
|
浏览 255
#include <stdio.h> #include <iostream> #include <algorithm> #include <stack> #include <string> using namespace...
P1206
删除公共字符 题解:
huanghu
回复 0
|
赞 1
|
浏览 109
#include <iostream> #include <vector> #include<string> #include<malloc.h> #include<algorithm> #include<math...
P1200
明明是我先的 题解:
huanghu
回复 0
|
赞 0
|
浏览 135
#include <iostream> #include <vector> #include<string> #include<malloc.h> #include<algorithm> #include<math...
P1018
击鼓传花 题解:
1576684866
回复 0
|
赞 0
|
浏览 165
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> typedef struct node...
P1240
首字母大写 题解:(C++)奇怪的解决办法。
Djiangxu
回复 1
|
赞 0
|
浏览 256
解题思路:(1)题目输入格式为一行未处理的字符串,我们可以使用char或者string两种变量类型来容纳这串字符。 根据题目下的示例我们可以知道输入的字符串中是存在括号的,这个时候我们不能简单的使用cin来获取这个字符串,因为cin在获取数据时遇到空格和回车会自动截止,不能够...
P1563
迷宫 题解:
猪蹄子全是肉
回复 1
|
赞 2
|
浏览 1.2k
#include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; typedef pair<...
P1290
日期差值 题解:成功AC
渐鸿于陆
回复 0
|
赞 0
|
浏览 204
#include<stdio.h> #include<stdlib.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int day(int n){ i...
P1290
日期差值 题解:有人能看出有啥问题吗?
渐鸿于陆
回复 2
|
赞 0
|
浏览 226
#include<stdio.h> #include<stdlib.h> int days[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int day(int n){  ...
P1563
典型bfs
成功保外的小孙
回复 1
|
赞 2
|
浏览 6.7k
题解不仅面向了多个出口,对于多入多出也可以应用 典型的bfs解法,利用队列和判别条件入队出队 为了加速算法,讨论了无入口/无出口的情况,直接输出 代码略微麻烦的地方在于找不到路径的情况,反复用了break和continue,若有改进请各位大佬指点 #include&...
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇