主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1566
P1566 确定比赛名次 答疑提问:求助,不知道哪点有问题
fzh
回复 1
|
赞 1
|
浏览 14
#include using namespace std; struct TNode { int data; TNode* rchild, * lchild; }; void Insert(TNo...
P5230
判断字符串是否有效 题解:经典栈问题
RingoCrystal
回复 0
|
赞 0
|
浏览 0
#include <bits/stdc++.h> using namespace std; int main() { string s; while(cin>>s){ stack<char>st; bool fla...
P1255
字符串排序2 题解:stable_sort()为什么是神
Theeastisred
回复 0
|
赞 0
|
浏览 0
#include<bits/stdc++.h> using namespace std; vector<int>w('z'+1,0); bool cmp(char a,char b){ if(w[a]<...
P2000
ISBN号码识别 题解:卡在75%了,求佬帮我看下哪里有问题
312143140
回复 0
|
赞 0
|
浏览 0
#include<stdio.h> int main(){ char arr[13]; scanf("%s",arr); int num[1...
P1317
直接使用字符串做递归判断,需要计算大于根的字串和小于根的字串
zjx140
回复 1
|
赞 1
|
浏览 6.9k
#include<iostream> using namespace std; string larger_than_root(string s){ //计算比根大的子串 int start_pos = 0; while(start_pos <...
P1240
布灵布灵
古娜拉黑暗之神
回复 1
|
赞 4
|
浏览 9.9k
#include<stdio.h> #include<string.h> int main() { char tem[100]; while(gets(tem) != NULL)&...
P1159
成绩排序2.0 题解:
XCR553
回复 0
|
赞 0
|
浏览 6
冒泡排序 #include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n;  ...
P1292
字母统计 题解:纯C语言 简单好理解
Xsw777
回复 0
|
赞 2
|
浏览 7
#include <stdio.h> #include <string.h> int main(){ char a[10000] = {0}; while(gets(a)){ &nbs...
P1018
击鼓传花 题解:链表模拟
samxz
回复 0
|
赞 0
|
浏览 12
#include<stdio.h> #include<stdlib.h> #include<string.h> typedef struct Node{ int data; struct Node* next; }Node; i...
P1011
日期 题解:
ryanausnar
回复 0
|
赞 0
|
浏览 7
#include<bits/stdc++.h> using namespace std; int main(){ int month[13] = {0,31,28,...
P1022
删除最大最小数 题解:想不明白为啥正确率只有百分之75,麻烦同学们看看
一起奋斗啊
回复 4
|
赞 4
|
浏览 141
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> int main() { int n; int i; ...
P1005
博学楼的阶梯 题解:
wwj0102
回复 0
|
赞 0
|
浏览 4
#include<bits/stdc++.h> using namespace std; int a[105]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ...
P1001
01序列 题解:使用一个while+一个01存储数组
AiLanKeSi
回复 0
|
赞 0
|
浏览 8
#include <iostream> using namespace std; void to_binary(int n,int arr[]) { int i = 5; while(n / ...
P5127
动态查找的问题 题解:map轻松搞定!
wwj0102
回复 0
|
赞 0
|
浏览 6
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,q; cin ...
P2019
字母排序 题解:
wwj0102
回复 0
|
赞 0
|
浏览 7
#include<bits/stdc++.h> using namespace std; typedef struct ac{ char c; int num; }ac; bool cmp(ac a, ac b){ if(a.num == b.num...
P1040
利润提成 题解:
samxz
回复 0
|
赞 0
|
浏览 19
#include <stdio.h> int main() { int profit; float bonus = 0; scanf("%d", &profit); const int thresholds[] = {100...
P1677
巨人排队 题解:c代码,有解析
202110405235
回复 0
|
赞 0
|
浏览 16
#include<bits/stdc++.h> int main(){ int n; int sum=0;//记录路队数 int temp; while(scanf("%d",&n)!=EOF){ //输入 ...
P1018
击鼓传花 题解:
jaygee_
回复 0
|
赞 0
|
浏览 19
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n); for(int i = 0; i < ...
P1259
进制转换2 题解:very good
西电机试专家
回复 0
|
赞 1
|
浏览 21
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>...
P1401
递归大法
老猫
回复 2
|
赞 24
|
浏览 8.6k
1、前序遍历的第一元素是整个二叉树的根节点 2、中序遍历中根节点的左边的元素是左子树,根节点右边的元素是右子树 3、后序遍历的最后一个元素是整个二叉树的根节点 #include <iostream> #include <string> #inc...
P1454
反序数 题解:清晰
西电机试专家
回复 0
|
赞 1
|
浏览 17
#include <bits/stdc++.h> using namespace std; int fan(int a){ int ans=0; while(a>0){ &nb...
P1027
删除字符串2 题解:不考虑新组合,del[i]存储跳跃点
samxz
回复 0
|
赞 1
|
浏览 158
#include<stdio.h> #include<stdlib.h> #include<string.h> int main(){ char s[1001]; gets(s); int n=strlen(s); int de...
P1197
动态规划
GENARDING
回复 0
|
赞 0
|
浏览 1
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ int dp[n+1]; dp[0]=1; dp[1]=1; ...
P1011
日期 题解:模拟
samxz
回复 0
|
赞 2
|
浏览 26
#include<stdio.h> #include<stdlib.h> void trans(int a) { switch(a) { case 0: { printf("Sunday"); break; } case...
P1563
BFS无权图
GENARDING
回复 0
|
赞 0
|
浏览 2
#include <bits/stdc++.h> using namespace std; const int MAX=110; char maze[MAX][MAX];//迷宫 int h,w;//迷宫宽和高; int sx,sy;//记录s的坐标 int dx...
P1014
加密算法 题解:
yeee700
回复 0
|
赞 0
|
浏览 1
#include <stdio.h> #include<string.h> int main(void) { char str[100]; gets(str); &...
P1177
查找学生信息 题解:
shiv15832
回复 0
|
赞 1
|
浏览 8
最直观的思路就是输入N,M后定义两个数组,例如reader[]表示:读者i喜欢的书号是多少,book[]表示喜欢j号书的读者有多少人,再遍历查看book[reader[i]],表示读者i喜欢的书总共有多少人喜欢,如果 == 1,就输出悲剧。代码如下: #include <bits/...
P1394
统计单词 题解:写出这么简单的代码也是神人了
西电机试专家
回复 0
|
赞 4
|
浏览 31
#include <bits/stdc++.h> using namespace std; //遇到单词就开始计数,遇到空格计数归零 int main(){ string s; &n...
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
|
浏览 6
#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
|
浏览 6
#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
|
赞 1
|
浏览 39
#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
|
浏览 8
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ priority_queue<int,vector<int>...
P1053
偷菜时间表 题解:
yeee700
回复 0
|
赞 0
|
浏览 37
#include<stdio.h> int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i...
P1437
日期类 题解:
yeee700
回复 0
|
赞 0
|
浏览 19
#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
|
浏览 12
#include <bits/stdc++.h> using namespace std; string sn[10]={ "zero","one","two","three","four","five","six","seven","eight","nine...
P1012
字符移动 题解:
山崎友希
回复 0
|
赞 2
|
浏览 38
#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
|
浏览 45
有其他题解用双for循环暴力搜索,确实在n诺能ac,但是只是n诺数据太小了,你可以试试第一行两个数都用10e7量级的,我跑代码用时40s。。。。 这里给一个计算运行时间(精确到纳秒级)的代码 #include <stdio.h> #include <window...
P1404
成绩排序 - 华科 题解:
shiv15832
回复 0
|
赞 1
|
浏览 16
知识点:在 C++ 中,string 类型重载了比较运算符(如 <, >, == 等),使得我们可以直接使用这些运算符来比较两个字符串的字典序。说人话就是字符串string的比较本身就是基于字典序,那问题就很简单了,只需要写一个cm...
P1294
后缀子串排序 题解:
shiv15832
回复 0
|
赞 0
|
浏览 13
显然解题分两步:1,获取子串。2,字典排序。 字典排序很简单,sort函数自然对字符串进行字典排序。而获取子串可以用c++自带的substr函数,具体用法不清楚的可以查一下CSDN或者Deepseek都可以,那么就基本解决了题目,只需要用一个vector存储截取下来的字符串就可以了。 ...
P1161
二叉树遍历 题解:
山崎友希
回复 0
|
赞 3
|
浏览 51
#include <stdio.h> typedef struct erchashu{//创建一个结构体 它叫erchashu char data;//数据域 struct...
1
2
我要提问
全站热榜
1
无法正确通过题目都是哪些原因造成的?
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
1017 幂次方 快速幂模板
5
A+B问题 题解:C
6
负二进制 题解:
7
题目难点:数学公式不断化解
8
逻辑很简单,但是实现却要小心多多
9
【23计算机考研】39所985院校录取分数线汇总
10
N诺成就值出炉,帮你一眼识别大神