NoobDream 首页 DreamJudge 院校信息 专业题库 模拟考试 机试真题 408真题 专业课程 兑换中心
登录 注册 上岸
    推  荐 择校分析 笔经面经 学习交流 我要提问 站内公告 调剂专题 精彩爆料 解题报告
    头像
    P1027 删除字符串2 题解:思路:先转换成小写,找到位置后把原字符串的对应位置置为空格,
    leo110
    回复 0 | 赞 0 | 浏览 11
    #include<iostream> #include<string> #include<vector> #include<sstream> using namespace std; //思路:先转换成小写,找到位置后把原字符串的对应位...
    头像
    P1012 字符移动 题解:利用两个char向量来完成
    leo110
    回复 0 | 赞 0 | 浏览 10
    #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; int main(){  &nb...
    头像
    P5228 在树中找到父节点和子节点之和最大的节点 题解:
    snake
    回复 0 | 赞 0 | 浏览 15
    要解决这个问题,我们需要找到完全二叉树中满足条件的节点:该节点的值加上其父节点的值以及所有子节点的值之和最大。具体步骤如下: 理解完全二叉树的结构:完全二叉树可以用数组来表示,其中对于索引为i的节点(从0开始计数),其左子节点的索引为2i+1,右子节点的索引为2i+2,父节点...
    头像
    P5228 P5228 在树中找到父节点和子节点之和最大的节点 答疑提问:
    sjr
    回复 1 | 赞 2 | 浏览 75
    这个题的答案是不是有问题? 这怎么看答案都是2啊
    头像
    P1934 数字游戏 - 中南大学 题解:动态规划
    snake
    回复 0 | 赞 1 | 浏览 68
    这道题目要求我们找出使用给定数字(可以重复使用)凑出目标数m所需的最少数字数量。如果无法凑出目标数,则返回-1。这是一个典型的动态规划问题,类似于背包问题。 方法思路 问题分析:我们需要用最少的数字组合来达到目标数m。每个数字可以重复使用,类似于完全背包问题,但这里我们...
    头像
    P1015 单链表 题解:只为锻炼手搓单链表和相关功能
    leo110
    回复 0 | 赞 1 | 浏览 21
    #include<bits/stdc++.h> using namespace std; struct Node{     int Element;     struct Node *Next; }; ...
    头像
    P1091 促销计算 题解:
    18919717626
    回复 0 | 赞 0 | 浏览 16
    #include<bits/stdc++.h> using namespace std; signed main(){     int pay;     while(cin>>pay){  ...
    头像
    P1934 数字游戏 - 中南大学 题解:
    Jayho
    回复 0 | 赞 1 | 浏览 92
    感觉这道题有点问题,因为用贪心思想居然能过,以下是ac的贪心代码。但是当n=3,m=6,数组元素分别为3 4 5时,实际答案是2,但是用以下代码则输出-1。这道题的正解应该是dfs与动态规划。 #include<bits/stdc++.h> using namespac...
    头像
    P1882 表面积 题解:
    Jayho
    回复 0 | 赞 1 | 浏览 99
    根据此题可得出k个圆柱的最大可视面积为 (k个圆柱的侧面积之和+ k个圆柱中最大的一个圆柱的底面积 ),因此我们可以把圆柱数组按照侧面积降序排列,这样的话前k个圆柱的侧面积总和是最大的,此时可分为两种情况: ①把前k个圆柱的侧面积累加,再加上前k个之中最大的一个底面积,得到ans1; ...
    头像
    P5204 字符串的字典排序 题解:
    Verse Q
    回复 0 | 赞 0 | 浏览 75
    #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; int main() { &n...
    头像
    P1011 日期 题解:
    iyishu
    回复 0 | 赞 0 | 浏览 113
    服了还考英语这题
    头像
    P2020 字符串转化 题解:
    故里526
    回复 0 | 赞 1 | 浏览 118
    #include<stdio.h> #include<string.h> int main(){ char a[100]; int i; int lenth; while(scanf("%s",a)!=EOF){ i...
    头像
    P1551 判断二叉树是否对称 题解:
    XCR553
    回复 0 | 赞 1 | 浏览 136
    //看了好几个都没有我的解法简单 #include <bits/stdc++.h> using namespace std; int main(){      string s;     &nb...
    头像
    P5104 约瑟夫问题的实现 题解:C语言实现
    Assassin123
    回复 0 | 赞 0 | 浏览 161
    #include "stdio.h" #include "stdlib.h" int main() { int n, k; scanf("%d %d", &n, &k); int flag1 = 0;//用于数k int ...
    头像
    P1035 简单背包问题 题解:
    机试过过过·
    回复 1 | 赞 4 | 浏览 216
    #include<bits/stdc++.h> // 包含标准库,方便使用各种功能 using namespace std; int main(){ int s, n; // 定义变量s表示背包的容量,n表示物品的数量 while(cin >&...
    头像
    P1125 求三角形的面积 题解:为啥过不去
    李志豪
    回复 1 | 赞 1 | 浏览 160
    #include<stdio.h> #include<math.h> int main(){     float x1,y1,x2,y2,x3,y3;     float s;   ...
    头像
    P5238 AB博弈 题解:
    知止而后动
    回复 0 | 赞 1 | 浏览 119
    这个问题类似于“拿石子游戏”,其中玩家每次可以拿1或2个石子,最后一个拿石子的人获胜。这种情况下,如果N是3的倍数,后手可以必胜;否则,先手可以必胜。
    头像
    P5244 数组划分 题解:
    fyy466
    回复 0 | 赞 1 | 浏览 173
    #include <stdio.h> #include <stdlib.h>   int max1(int i,int j,int* a ){ int max=0; for(int k=i;k<j;k++){ if(a[k]...
    头像
    P5244 数组划分 题解:
    fyy466
    回复 0 | 赞 0 | 浏览 163
    #include <stdio.h> #include <stdlib.h>   int max1(int i,int j,int* a ){ int max=0; for(int k=i;k<j;k++){ if(a[k]...
    头像
    P1020 最长连续因子 题解:使用一个长度量时刻记录,同时不停与最长变量对比
    AiLanKeSi
    回复 1 | 赞 19 | 浏览 387
    #include <stdio.h> int main() {     int length = 0;     int longest = 0;     int position...
    头像
    P1011 日期 题解:纯c
    李志豪
    回复 0 | 赞 5 | 浏览 237
    #include<stdio.h> void weeka(int m,int d){     int m_d[]={31,29,31,30,31,30,31,31,30,31,30,31};     int i; ...
    头像
    P1011 日期 题解:纯c
    李志豪
    回复 0 | 赞 2 | 浏览 181
    #include<stdio.h> void weeka(int m,int d){     int m_d[]={31,29,31,30,31,30,31,31,30,31,30,31};     int i; ...
    头像
    P1097 负二进制 题解:
    Jayho
    回复 0 | 赞 1 | 浏览 174
    暴力枚举 把一个变量从1开始递增,转化为二进制进行基数为-2的运算,所得结果与输入数比较。但是比较耗时。。。 #include<bits/stdc++.h> using namespace std; string judge(int n) {  &nbs...
    头像
    P1394 统计单词 题解:
    山崎友希
    回复 0 | 赞 5 | 浏览 219
    #include<stdio.h> #include<string.h> #define MAXSIZE 100 int main(){     char string[MAXSIZE];      ...
    头像
    P1580 一元三次方程求解 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 73
    #include<stdio.h> double a,b,c,d; double f(double x){     double result=a*x*x*x+b*x*x+c*x+d;     return...
    头像
    P1891 元数据 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 109
    #include<stdio.h> #include<string.h> #include<math.h> int main(){//那我问你,10的九次方是多少? //1000000000  确实 这就是10的9次方 //10000...
    头像
    P2015 涂颜色 题解:
    DASH106
    回复 0 | 赞 2 | 浏览 164
    #include <bits/stdc++.h> using namespace std; typedef long long ll; ll string_mod(const string&s,ll mod){     ll res = ...
    头像
    P1454 反序数 题解:
    火火火。。。
    回复 0 | 赞 0 | 浏览 177
    #include<iostream> #include<stdio.h> using namespace std; int main() {     for (int i = 1000; i <= 9999; i++) ...
    头像
    P1454 反序数 题解:
    火火火。。。
    回复 0 | 赞 1 | 浏览 142
    #include<iostream> #include<stdio.h> using namespace std; int main() {     for (int i = 1000; i <= 9999; i++) ...
    头像
    P1556 三元组 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 105
    #include<stdio.h> int main(){     int N;     scanf("%d",&N);     int j=1; &nb...
    头像
    P1095 Y/N 题解:
    曦熙
    回复 0 | 赞 2 | 浏览 243
    #include<bits/stdc++.h> using namespace std; int main(){ int A,B,C,D;     int M=0,j;     cin>>A>&...
    头像
    P1888 倒杨辉三角 题解:
    20210512061
    回复 0 | 赞 1 | 浏览 178
    #include<stdio.h> #include<stdlib.h> int main(){     int a;     while(scanf("%d",&a)!...
    头像
    P1767 元素位置 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 161
    #include<stdio.h> int main(){     int n;     scanf("%d",&n);     int a[n]; &n...
    头像
    P1689 元素交换 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 119
    #include<stdio.h> int main(){//给定一个长度为 [公式] 数组,将其中第偶数位置的元素与前一个元素交换。     int n;     scanf("%d",&...
    头像
    P1883 达到回文数 题解:
    山崎友希
    回复 0 | 赞 0 | 浏览 101
    #include<stdio.h> #include<string.h> #include<math.h> int Reverse(int x){//Reverse函数实现把传进来的参数x翻转的效果!     &nb...
    头像
    P1411 二叉排序树2 题解:
    诗岸梦行舟
    回复 0 | 赞 0 | 浏览 153
    #include<stdlib.h> #include<stdio.h> typedef struct node{ int data; struct node* lchild; struct node* rchild; }node; void...
    头像
    P1208 2048的游戏 题解:优先队列so easy
    西电机试专家
    回复 0 | 赞 4 | 浏览 262
    #include<bits/stdc++.h> using namespace std; int main(){     int n;     cin>>n;     ...
    头像
    P5291 ASCII码排序 题解:神人题
    西电机试专家
    回复 0 | 赞 0 | 浏览 202
    #include<bits/stdc++.h> using namespace std; bool cmp(char a,char b){     return a<b; } int main(){    &nbs...
    头像
    P1888 倒杨辉三角 题解:long long long long
    西电机试专家
    回复 0 | 赞 0 | 浏览 156
    #include<bits/stdc++.h> using namespace std; int main(){     int n;     while(cin>>n) {  &nbs...
    头像
    P1045 平方和与倒数和 题解:
    曦熙
    回复 0 | 赞 2 | 浏览 178
    #include<bits/stdc++.h> using namespace std; int main(){    int a,b;     double c,f=0.0,q;     c...
    头像
    P1004 句子正序 题解:用vector将每个单词存储再进行输出
    18919717626
    回复 0 | 赞 0 | 浏览 97
    #include <iostream> #include <vector> #include <sstream> using namespace std; int main() {     string sentence; ...
    头像
    P1855 最大公共子串 题解:
    18919717626
    回复 0 | 赞 0 | 浏览 125
    #include <iostream> #include <cstring> #include <bits/stdc++.h> using namespace std; int main() {     string s1,...
    头像
    P1292 字母统计 题解:
    16696033405
    回复 0 | 赞 0 | 浏览 178
    #include <stdio.h> #include <stdlib.h> #include<string.h> #define MAX 1000 int main() {     char s[MAX];  ...
    头像
    P1312 畅通工程 题解:暴力
    zxjrheaven
    回复 0 | 赞 1 | 浏览 222
    #include <bits/stdc++.h> using namespace std; struct node {     int st;     int ed;     ...
    头像
    P1566 确定比赛名次 题解:
    路西法
    回复 0 | 赞 1 | 浏览 118
    #include<stdio.h> #include<vector> #include<queue> using namespace std; int main(){     int n,m;  &nb...
    头像
    P1544 合并果子 题解:暴力
    zxjrheaven
    回复 0 | 赞 0 | 浏览 211
    #include <iostream> #include <queue> #include <vector> using namespace std; int main() {     int n;   &n...
    头像
    P1013 判断素数 题解:
    16696033405
    回复 0 | 赞 4 | 浏览 178
    #include<stdio.h> #include<string.h> #include<ctype.h> #include<math.h> #define MAX 1000 int main(){    &nb...
    头像
    P1185 全排列 题解:借用next_permutation函数
    路西法
    回复 0 | 赞 2 | 浏览 274
    提前打印一个本身 #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; int main(){     c...
    头像
    P1019 字母频率 题解:非常棒的题解
    西电机试专家
    回复 0 | 赞 1 | 浏览 141
    #include<bits/stdc++.h> using namespace std; int main(){     map<char,int> M;     string s;  &n...
    头像
    P1329 统计同成绩学生人数 map
    阿灿
    回复 0 | 赞 2 | 浏览 95
    #include<bits/stdc++.h> using namespace std; int main(){ int n; int x; int y; while(cin>>n&&n!=0){ map<int,in...
    • 1
    • 2
我要提问
全站热榜
1 无法正确通过题目都是哪些原因造成的?
2 机试如何才能快速提高?
3 题目难点:数学公式不断化解
4 [置顶]计算机考研择校分析【25考研必读】
5 逻辑很简单,但是实现却要小心多多
6 A+B问题 题解:C
7 1017 幂次方 快速幂模板
8 广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
9 日期 题解:
10 负二进制 题解:
关于我们 加入我们 友情链接
NoobDream       The road of your choice, you have to go on !       粤ICP备16082171号-1

哔哩哔哩

官方微信

官方微博