主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1240
首字母大写 题解:非常好理解
西电机试专家
回复 0
|
赞 0
|
浏览 14
#include <bits/stdc++.h> using namespace std; //注意,题目中说输入字符串,那么可能不止含有字母,所以应先判断是否为字母 int main(){ st...
P1377
旋转矩阵 - 北航 题解:
camling
回复 0
|
赞 1
|
浏览 6
一直80%,找不到哪里错了,求大佬解惑 #include <bits/stdc++.h> using namespace std; int main(){ int a; &n...
P1736
求30的倍数 题解:挑战最短代码ac
Y969432769845
回复 0
|
赞 1
|
浏览 11
#include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; sort...
P1180
最简真分数 题解:
ryanausnar
回复 1
|
赞 5
|
浏览 80
#include<bits/stdc++.h> //#include<algorithm> 中有__gcd(int a,int b); 但是不一定都支持 using namespace std; //...
P1001
01序列 题解:
samxz
回复 0
|
赞 1
|
浏览 16
#include<stdio.h> #include<stdlib.h> int era[6]={0}; int er(int n,int deep){ if(n==0) return 0; er(n/2,deep-1); era[deep]=...
P1002
数字统计 题解:
samxz
回复 0
|
赞 0
|
浏览 13
#include<stdio.h> #include<stdlib.h> int times; void suan(int lll,int rrr){ times=0; for(int i=lll;i<=rrr;i++){ int ...
P1008
0和1的个数 题解:递归
samxz
回复 0
|
赞 0
|
浏览 8
#include<stdio.h> #include<stdlib.h> int n0,n1; int er(int a){ if(a==0) return 0; er(a/2); if((a%2)==0){ n0++; }else{...
P1493
连续合数段 题解:纯C语言
Xsw777
回复 0
|
赞 1
|
浏览 15
#include <stdio.h> #include <math.h> int IsNum(int n){ if(n<2) return 0...
P1022
删除最大最小数 题解:注意max==min和只有一个数时的测试用例
samxz
回复 0
|
赞 2
|
浏览 46
#include<stdio.h> #include<stdlib.h> #include <limits.h> int main(){ int n,a[1001]; scanf("%d",&n); int max,min; ...
P1003
翻转数的和 题解:
ryanausnar
回复 0
|
赞 1
|
浏览 25
//方法一 使用string #include<bits/stdc++.h> using namespace std; int main(){ string a,b; &nbs...
P1106
排序2 题解:
Theeastisred
回复 0
|
赞 1
|
浏览 10
致死量 #include<bits/stdc++.h> using namespace std; void InsertSort(vector<int>&a){ int i,j; &n...
P1371
搬水果 题解:优先队列,哈夫曼树思路
RingoCrystal
回复 0
|
赞 0
|
浏览 11
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ priority_queue<int,vector<int>...
P1053
偷菜时间表 题解:
yeee700
回复 0
|
赞 0
|
浏览 52
#include<stdio.h> int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i...
P1437
日期类 题解:
yeee700
回复 0
|
赞 1
|
浏览 69
#include<stdio.h> int main(){ int m; scanf("%d",&m); int months[13]={0,31,28,31,3...
P1646
TAT的个数 题解:二分计数
RingoCrystal
回复 0
|
赞 0
|
浏览 5
#include <bits/stdc++.h> using namespace std; int main() { string s; while(cin>>s){ long long ct=0; for(auto x:s)...
P1323
A + B 加强版 题解:看似复杂,其实简单的输入手段
RingoCrystal
回复 0
|
赞 1
|
浏览 17
#include <bits/stdc++.h> using namespace std; string sn[10]={ "zero","one","two","three","four","five","six","seven","eight","nine...
P1012
字符移动 题解:
山崎友希
回复 0
|
赞 4
|
浏览 49
#include<stdio.h> #include<string.h> #define maxsize 100 int main(){ char string[maxsize];//数组A用于存除了数字外的一切东西 &n...
P1412
大整数排序 题解:卡80%原因
shiv15832
回复 0
|
赞 0
|
浏览 7
卡80卡了半天,没看见多组输入,多组输入数据一定要用while(cin >> n)这样的格式。 本题思路其实很简单,字符串长度一样,直接字典排序,用sort就可以解决,但长度不一样eg:333和11111111111,字典排序很明显11111111要更小,所以长度不一样就输出...
P1960
子序列-ECNU 题解:其他题解用双for循环是错的
Y969432769845
回复 0
|
赞 2
|
浏览 48
有其他题解用双for循环暴力搜索,确实在n诺能ac,但是只是n诺数据太小了,你可以试试第一行两个数都用10e7量级的,我跑代码用时40s。。。。 这里给一个计算运行时间(精确到纳秒级)的代码 #include <stdio.h> #include <window...
P1404
成绩排序 - 华科 题解:
shiv15832
回复 0
|
赞 1
|
浏览 19
知识点:在 C++ 中,string 类型重载了比较运算符(如 <, >, == 等),使得我们可以直接使用这些运算符来比较两个字符串的字典序。说人话就是字符串string的比较本身就是基于字典序,那问题就很简单了,只需要写一个cm...
P1294
后缀子串排序 题解:
shiv15832
回复 0
|
赞 1
|
浏览 17
显然解题分两步:1,获取子串。2,字典排序。 字典排序很简单,sort函数自然对字符串进行字典排序。而获取子串可以用c++自带的substr函数,具体用法不清楚的可以查一下CSDN或者Deepseek都可以,那么就基本解决了题目,只需要用一个vector存储截取下来的字符串就可以了。 ...
P1161
二叉树遍历 题解:
山崎友希
回复 0
|
赞 3
|
浏览 54
#include <stdio.h> typedef struct erchashu{//创建一个结构体 它叫erchashu char data;//数据域 struct...
P1020
最长连续因子 题解:
homelesspear
回复 0
|
赞 6
|
浏览 43
我的思路:首先找出所有因子,放到一个数组里,然后在数组里找最长连续的数,一个问题分成两个简单问题处理。 #include<stdio.h> int main(){ int num; scanf(...
P1817
成绩再次排序 题解:C语言疯狂if嵌套
ASDF807
回复 1
|
赞 1
|
浏览 35
#include<stdio.h> #include<string.h> struct student{ char name[100]; int chinese; &nbs...
P1412
写复杂了
可可爱爱草莓派
回复 1
|
赞 0
|
浏览 1.4k
#include<bits/stdc++.h> using namespace std; struct Big{ string num; int len; }big[110]; bool cmp(Big a,Big...
P1286
P1286 最短路径 部分样例未通过,不知道为什么
sheep276
回复 2
|
赞 2
|
浏览 51
#include <bits/stdc++.h> using namespace std; int n,m; struct edge { int u; int v; int w; }; vector<edge>edges; ...
P1051
日期计算 题解:
yeee700
回复 0
|
赞 0
|
浏览 37
有大佬指出哪里错误吗,为啥只有50%的正确率 #include <stdio.h> typedef struct node{ int year,month,day; }p; int main(){ p date; ...
P1411
二叉排序树2 题解:递归建树
fzh
回复 0
|
赞 2
|
浏览 20
#include<iostream> using namespace std; struct TNode { int data; TNode* rchild, * lchild; }; ...
P2006
字符串对齐 题解:C语言
ASDF807
回复 0
|
赞 0
|
浏览 8
#include<stdio.h> #include<string.h> int main() { int n; scanf("%d",&n); &nbs...
P1461
最简单的方法
GENARDING
回复 0
|
赞 0
|
浏览 18
#include <bits/stdc++.h> using namespace std; int reverseNum(int n){ return n/1000+((n/100)%10)*10+((n/10)%10)*100+(n%10)*1000; ...
P1401
二叉树遍历2 题解:递归建树
fzh
回复 0
|
赞 5
|
浏览 76
#include<iostream> #include<string> using namespace std; struct TreeNode { char data;  ...
P2000
ISBN号码识别 题解:没注意10是X,输入输出不太熟练,能做出来就行。。。
catkin08
回复 0
|
赞 0
|
浏览 11
#include <stdio.h> //本人是笨蛋做法 int main() { int arr[10]; int sum=0; char arr1[13]; int j=0; scanf("%s...
P5268
二叉树的深度2 题解:
山崎友希
回复 0
|
赞 2
|
浏览 40
#include<stdio.h> typedef struct tree{ char data; struct tree *Lchild,*Rchild;//定义结构体指针 }*BTt...
P1002
数字统计 题解:简单的思路
西电机试专家
回复 0
|
赞 1
|
浏览 16
#include <bits/stdc++.h> using namespace std; int num2(int a){ int ans=0; while(a>0){ ...
P1023
IP地址 题解:注意0.0.0.0这个地址,80%过不了,找好久
GENARDING
回复 0
|
赞 4
|
浏览 62
#include <bits/stdc++.h> using namespace std; // 将十进制的字符串转换为十六进制字符串 string convert(string s) { int res = 0; for (int i = 0;...
P1151
成绩排序 题解:
samxz
回复 0
|
赞 5
|
浏览 72
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct stu { char name[1001]; int sc; } stu; int main(...
P1067
括号的匹配 题解:用栈解决
fzh
回复 0
|
赞 1
|
浏览 54
#include<iostream> #include<stack> #include<map> #include<string> using namespace std; int main() { &nb...
P5205
学生成绩排序 - 西农 题解:
山崎友希
回复 0
|
赞 0
|
浏览 9
#include<stdio.h> #include<string.h> typedef struct student{ char NO[100]; char NAME[100]; &...
P5214
成绩排名 题解:
山崎友希
回复 0
|
赞 0
|
浏览 21
#include<stdio.h> int main(){ //对 n 个同学的考试成绩从大到小排名,成绩相同的算同一名。 //求排名为 m 的成绩。若无排名为m的成绩,输出最后一名的成绩。 &nb...
P1823
学生成绩排序 题解:
山崎友希
回复 0
|
赞 0
|
浏览 18
#include<stdio.h> #include<string.h> typedef struct student{ char NO[100]; int scorea,scoreb,...
P1010
排序 题解:笨蛋算法
samxz
回复 0
|
赞 1
|
浏览 110
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ int n; scanf("%d",&n); int a[1001]; for(int ...
P3666
单词翻转 题解:
samxz
回复 0
|
赞 0
|
浏览 95
#include<stdio.h> #include<string.h> int main(){ char a[10001]; int i=0; char *x=gets(a); char *p[1001]; i...
P1027
删除字符串2 题解:方法二:不考虑删除后是否出现新组合
xddddddddddddd
回复 0
|
赞 1
|
浏览 20
#include<iostream> #include<string> using namespace std; int main(){ string s; cin >> ...
P1978
选择排序 题解:带注释,题中要求的选择排序实现
AiLanKeSi
回复 0
|
赞 0
|
浏览 19
网上有许多种不同的直接选择排序实现方法,很多代码所实现的最终结果是相同的,但是其中的过程逻辑又是各有不同的。 按照题目要求,下方代码方能满足题意。 #include <iostream> using namespace std; void Select_Sort(i...
P1027
删除字符串2 题解:考虑是否出现新组合,KMP
xddddddddddddd
回复 0
|
赞 1
|
浏览 42
#include<iostream> #include<string> #include<algorithm> #include<vector> using namespace std; void getNext(const str...
P1261
字符串排序3 题解:使用vector +sort(),此方法适用于多种场景
GENARDING
回复 0
|
赞 3
|
浏览 38
使用vector +sort(),此方法适用于多种场景,对此不熟悉的可记为这类相关问题的通解 #include <bits/stdc++.h> using namespace std; // 自定义比较函数 bool cmp(const string &...
P1261
字符串排序3 题解:
GENARDING
回复 0
|
赞 2
|
浏览 15
使用vector +sort(),此方法适用于多种场景,对此不熟悉的可记为这类相关问题的通解 #include <bits/stdc++.h> using namespace std; // 自定义比较函数 bool cmp(const string &...
P1008
0和1的个数 题解:超简单思路
西电机试专家
回复 0
|
赞 2
|
浏览 30
#include <bits/stdc++.h> using namespace std; //除基取余法 int main(){ int a; cin&g...
P1001
01序列 题解:笨蛋小美的做法
西电机试专家
回复 0
|
赞 0
|
浏览 26
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; for(a=0;a&...
P1040
利润提成 题解:打表
西电机试专家
回复 0
|
赞 2
|
浏览 52
#include <bits/stdc++.h> using namespace std; int main(){ long long jj; cin>...
1
2
我要提问
全站热榜
1
无法正确通过题目都是哪些原因造成的?
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
1017 幂次方 快速幂模板
5
A+B问题 题解:C
6
题目难点:数学公式不断化解
7
负二进制 题解:
8
逻辑很简单,但是实现却要小心多多
9
【23计算机考研】39所985院校录取分数线汇总
10
N诺成就值出炉,帮你一眼识别大神