主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P2016
平衡字符串 代码是copy的,只是对代码逻辑做解释
123456608
回复 0
|
赞 1
|
浏览 14
//2016-平衡字符串 #include<bits/stdc++.h> using namespace std; //正确答案 #include <iostream> #include <vector> #include...
P1051
日期计算 题解:AC为50%,不知道哪里有问题,求解
圣灵传说
回复 2
|
赞 2
|
浏览 48
#include <bits/stdc++.h> using namespace std; int main(){ int year,month,day;int sum=0;int Month[13]...
P1161
请问一下,我这个为什么报运行时错误呀,本地ide运行测试用例是对的
wut to hust
回复 1
|
赞 1
|
浏览 18
#include <bits/stdc++.h> using namespace std; typedef struct node { char data; node* l, * r; }*tre...
P895
正方形数组的数目 是一道经典的用回溯法解决排列组合的问题
123456608
回复 0
|
赞 0
|
浏览 14
//895-正方形数组的数目 #include <iostream> #include <vector> #include <algorithm> #include <cmath> using namespace std; ...
P1317
二叉搜索树 题解:效率不是很高,但是好理解
RingoCrystal
回复 0
|
赞 0
|
浏览 9
#include <bits/stdc++.h> using namespace std; struct tnode{ char val; tnode *left,*right; tnode():val(' '),left(nullptr)...
P1561
二叉树(北京邮电大学) 题解:先序建树,中序递归锁定
RingoCrystal
回复 0
|
赞 0
|
浏览 10
#include <bits/stdc++.h> using namespace std; struct tnode{ char val; tnode *left,*right; tnode():val(' '),left(nullptr)...
P1401
二叉树遍历2 题解:利用先序建树
RingoCrystal
回复 0
|
赞 0
|
浏览 7
#include <bits/stdc++.h> using namespace std; struct tnode{ char val; tnode *left,*right; tnode():val(' '),left(nullptr)...
P1009
随机数 题解:
赖建霖
回复 0
|
赞 0
|
浏览 14
//没看懂想问什么 #include <bits/stdc++.h> using namespace std; int main() { cout << 210 << endl; re...
P1259
进制转换2 题解:
lingdongyang
回复 5
|
赞 6
|
浏览 1.3k
用gets(s)!=NULL只有50%正确率 scanf("%s",s)!=EOF才能100% 第一种 #include<stdio.h> #include<math.h> #include<string.h> ...
P1225
谁是你的潜在朋友 题解:map vector联合
RingoCrystal
回复 0
|
赞 0
|
浏览 17
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin>>n>>m){ map<int,std::vec...
P1046
完数 题解:平方范围下判断,同时存储
RingoCrystal
回复 0
|
赞 0
|
浏览 22
#include <bits/stdc++.h> using namespace std; bool isPerfectNumber(int num,vector<int>&a) { vector<int>b; if ...
P1374
找最小数 题解:自定义比大小,利用cpp机制
RingoCrystal
回复 0
|
赞 0
|
浏览 16
#include <bits/stdc++.h> using namespace std; struct newInt{ int x,y; newInt():x(0),y(0){} newInt(int x,int y):x(x),y(y)...
P1353
最大公约数 题解:__gcd(int x,int y)
RingoCrystal
回复 0
|
赞 0
|
浏览 13
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; while(cin>>a>>b){ cout<<__gcd(a...
P1049
猴子吃桃 题解:函数很简单
RingoCrystal
回复 0
|
赞 0
|
浏览 12
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n]; a[0]=1; ...
P1221
旋转矩阵 题解:三种操作,三个函数
RingoCrystal
回复 0
|
赞 1
|
浏览 37
#include <bits/stdc++.h> using namespace std; vector<vector<int>> op1(vector<vector<int>>a){ vector<vec...
P1420
DFS or BFS
uno!
回复 1
|
赞 1
|
浏览 4.4k
#include<iostream> #include<cstdlib> #include<cstdio> #include<unordered_map> using namespace std; int n,limit,mm;...
P1939
P1939 南京理工-最短路径问题 答疑提问:
jsd
回复 1
|
赞 2
|
浏览 19
求助这个题,通过率80%, 不知道哪里出现问题 P1939 #include<bits/stdc++.h> #define INF 9999 using namespace std; typedef pair<int, int> p; ...
P1334
最大连续子序列 题解:深度分析dp数组的本质及扩展条件
RingoCrystal
回复 0
|
赞 0
|
浏览 29
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ if(n==0){break;} int ...
P1564
石油储藏 题解:挖掘解决法
RingoCrystal
回复 0
|
赞 0
|
浏览 24
#include <bits/stdc++.h> using namespace std; //挖掘方向 vector<vector<int>> direction {{-1, 0}, {-1, 1}, {0, 1}, {1, 1}, {1, ...
P1027
删除字符串2 题解:
海的那边
回复 0
|
赞 0
|
浏览 32
#include <bits/stdc++.h> using namespace std; int main() { string str; getline(cin,str); ...
P1177
查找学生信息 题解:带有注释的C++题解
西电机试专家
回复 0
|
赞 1
|
浏览 27
#include <bits/stdc++.h> using namespace std; int main(){ int n,M,i; while(cin>>n>&g...
P1479
01字符串 题解:数学推理,公式同feibo
RingoCrystal
回复 0
|
赞 1
|
浏览 39
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int dp[n+1]; dp[0]=1;...
P1404
成绩排序 - 华科 题解:自定义排序函数
RingoCrystal
回复 0
|
赞 0
|
浏览 44
#include <bits/stdc++.h> using namespace std; struct SC{ string name; int age; int score; SC():name(""),age(0),scor...
P1086
采药 题解:经典01背包问题
RingoCrystal
回复 0
|
赞 0
|
浏览 40
#include <bits/stdc++.h> using namespace std; int main(){ int t,n; while(cin>>t>>n){ int dp[n+1][t+1]; ...
P1123
小偷的背包 题解:详细解释一下适配背包问题
RingoCrystal
回复 0
|
赞 0
|
浏览 48
适配背包问题有两种,第一种就是这种,不存在最优结果的适配问题,也就是我们只考虑能否放下的可能性是否存在,但是不考虑价值,第二种就是考虑价值的。 对于第一种的解法,其实很简单,我们只需要利用布尔型的背包解决即可,全部的情况就只有这几种,当前物品对于当前背包大小,能放入,则判定,这时候不需要...
P1175
剩下的树 题解:数组存一下
RingoCrystal
回复 0
|
赞 0
|
浏览 43
#include <bits/stdc++.h> using namespace std; int main(){ int l,m; while(cin>>l>>m){ int a[l]; ...
P1176
十进制和二进制 题解:
Anya-H
回复 0
|
赞 1
|
浏览 68
看到输入的大小就应该知道是大数模拟类, 需要开数组来存储和运算 #include <iostream> #include<string> #include<algorithm> #include<vector> #include...
P1012
字符移动 题解:
kaikai
回复 0
|
赞 0
|
浏览 64
#include<bits/stdc++.h> using namespace std; int main() { string a; cin>>a; string b; for (int i = 0; i < a....
P2005
出栈入栈合法性 题解:
kaikai
回复 0
|
赞 0
|
浏览 46
#include<bits/stdc++.h> using namespace std; int main() { string s; stack<char> sta; cin...
P1188
数组对数 题解:
kaikai
回复 0
|
赞 0
|
浏览 48
#include<bits/stdc++.h> using namespace std; int main() { int n,m,x; cin>>n>>m>>x; ...
P1134
矩阵翻转 题解:直接打印
RingoCrystal
回复 0
|
赞 1
|
浏览 77
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n][n]; for(int ...
P1111
斐波那契数列 题解:dp
RingoCrystal
回复 0
|
赞 1
|
浏览 76
#include <bits/stdc++.h> using namespace std; int main(){ int n; long long a[80]; a[0]=a[1]=1; a[2]=2; for(int...
P1176
十进制和二进制 题解:手工求模,求乘算模拟
RingoCrystal
回复 0
|
赞 1
|
浏览 73
#include <bits/stdc++.h> using namespace std; string decimalToBinary(string decimal) { string binary = ""; while (decim...
P1255
字符串排序2 题解:stablesort,大小写同时排序
RingoCrystal
回复 0
|
赞 3
|
浏览 92
#include <bits/stdc++.h> using namespace std; bool compare(char c,char b){ if(c>='A'&&c<='Z')c=c-'A'+'a'; if(b&...
P1081
猴子报数 题解:约瑟夫问题
RingoCrystal
回复 0
|
赞 1
|
浏览 67
#include <bits/stdc++.h> using namespace std; int main(){ int n,p,m; while(cin>>n>>p>>m){ if(n==...
P1261
字符串排序3 题解:getchar compare自定义
RingoCrystal
回复 0
|
赞 0
|
浏览 69
#include <bits/stdc++.h> using namespace std; bool compare(string a,string b){ return a.size()<b.size(); } int main(){ ...
P1216
旋转方阵 题解:方块收缩模拟输出
RingoCrystal
回复 0
|
赞 2
|
浏览 84
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ vector<vector<int>>...
P1172
最大序列和 题解:dp思路
RingoCrystal
回复 0
|
赞 1
|
浏览 68
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ vector<long long>a(n) ; ...
P1174
大阶乘超详细解析
blackevil
回复 1
|
赞 2
|
浏览 3.6k
用整型数组来保存大阶乘结果。 原理:因为根据乘法的原理两个数相乘,这样可以保证每次相乘的数能够被int容纳下 (假设都是三位整数)可以看作a分别乘上b的个位,然后只保留结果的个位赋给数组,将剩余的前面的所有位赋给进位数 ,然后将a乘上b的十位,并将刚才各位进位的数加上这次的结...
P1018
击鼓传花 题解:vector手撕约瑟夫
RingoCrystal
回复 1
|
赞 1
|
浏览 77
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ vector<int>a(n); ...
P1377
旋转矩阵 - 北航 题解:旋转后判断
RingoCrystal
回复 0
|
赞 2
|
浏览 88
#include <bits/stdc++.h> using namespace std; vector<vector<int>> reverseMatrix(vector<vector<int>>a){ int...
P1474
大整数加法 题解:struct内部写法
RingoCrystal
回复 1
|
赞 0
|
浏览 75
#include <bits/stdc++.h> using namespace std; const int LEN=1001; struct BigInteger{ int data[LEN]; int length; void in...
P3501
回文数的判断 题解:reverseInt方法
RingoCrystal
回复 0
|
赞 0
|
浏览 80
#include <bits/stdc++.h> using namespace std; int reverseInt(int x){ int ans=0; while(x!=0){ ans*=10; ans+=...
P5104
约瑟夫问题的实现 题解:Vector向量解法
RingoCrystal
回复 0
|
赞 1
|
浏览 76
这里根据本题,提供两个约瑟夫问题的题解,我们依靠动态链接库里面的向量辅助处理,方便的处理中间的的元素的删除,当然,如果你的学校不支持这个,我建议你采用循环链表,标记0位置即可达到同样的目的 此段代码为题解,n为数量,m为步数 #include <bits/stdc++...
P1034
水仙花数 题解:
Laaaaaaaaa09
回复 0
|
赞 0
|
浏览 57
#include <bits/stdc++.h> using namespace std; int main(){ int a,n,m,count=0,num=0; &...
P1035
疑问:请问内层循环为什么要从大到小啊?
123456608
回复 4
|
赞 2
|
浏览 108
一维数组要从大到小遍历我能理解,二维数组的第二个for循环为什么也要从大到小才行呢? //1035-简单背包问题 #include<bits/stdc++.h> using namespace std; int main(){ int s...
P1476
查找学生信息2 题解:正确率只有33%,id不要用int类型改用string过了
Nyakahashi
回复 1
|
赞 1
|
浏览 94
#include using namespace std; typedef struct Student{ string id; string name; string sex; string score; }St...
P1032
变位词 (哈希表)题解:
我与代码的故事
回复 0
|
赞 1
|
浏览 92
#include<bits/stdc++.h> using namespace std; int n; unordered_map<char, int> h; bool check(string a, string b) { for(int ...
P2015
疑问:对幂指数进行n%(MOD-1)的操作的原理是什么
123456608
回复 2
|
赞 2
|
浏览 92
佬们能不能 解答一下,对幂指数进行n%(MOD-1)的操作的原理是什么啊? //2015涂颜色 #include<bits/stdc++.h> using namespace std; const int MOD=1000000007; ...
P2015
涂颜色 题解:欧拉定理/费马小定理降幂+快速幂
考研小助手
回复 0
|
赞 0
|
浏览 88
这题容易发现规律,每一行有2种涂法(交叉式的涂),而跟有多少列没有关系。 所以ans = 2^n%mod; 由于n特别大,所以这题重点就是高精度的计算。 高精度的 幂并且取模运算 会想到用 欧拉定理降幂+快速幂。 对于欧拉定理,有个欧拉函数: 定义: 在数论中,对于一个正整数n,欧...
P1020
最长连续因子 题解:纯C
chenshoumin
回复 0
|
赞 2
|
浏览 93
#include<stdio.h> //读题:最长连续因子可以理解为一个数的所有因子按从小到大排序,其中最长的连续序列 //思路:从2到n,依次判断是否为因子,记录当前因子序列的起点和长度,当出现非因子时,判断当前序列是否最长,保存到最长序列起点和长度变量中,最后输出最...
P1111
斐波那契数列 题解:纯C
chenshoumin
回复 0
|
赞 2
|
浏览 88
#include <stdio.h> int main(){ int n; long long an[71]={1,1,2}; while(scanf(&q...
P1047
分数求和 题解:纯C
chenshoumin
回复 0
|
赞 1
|
浏览 107
#include<stdio.h> double fun(int n){ if(n==1) return 1; &nbs...
P1040
利润提成 题解:纯C
chenshoumin
回复 0
|
赞 1
|
浏览 110
#include<stdio.h> int main(){ double x=0; double y=0; scanf("%lf", &...
P5132
车厢的重组 题解:
RingoCrystal
回复 0
|
赞 0
|
浏览 99
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n) { int a[n]; for(int i=0; i<n; i++)ci...
P2017
上升序列 题解:
RingoCrystal
回复 0
|
赞 0
|
浏览 89
#include <bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n],b[n]; for(int i=0;i<n;i++){...
P1156
质因数个数 题解:
今夕何夕12211
回复 1
|
赞 1
|
浏览 606
q求助 显示超时 准确率只有75% #include <stdio.h> #include <stdlib.h> #include <string.h> int isprime(int n) { int sqt=s...
P1627
P1627 上交2018 Problem B 答疑提问:
jsd
回复 2
|
赞 2
|
浏览 114
还是只有50%的通过率,在线求助题1627 #include<bits/stdc++.h> using namespace std; int main() { string s1, s2; while(cin...
P1034
水仙花数 题解:
海的那边
回复 0
|
赞 0
|
浏览 80
#include<bits/stdc++.h> //#include <stdio.h> //#include <stdbool.h> // 判断一个数是否为水仙花数 bool isNarcissistic(int num) { ...
P1887
不重复数 题解:
上下四方
回复 0
|
赞 1
|
浏览 88
#include <iostream> using namespace std; int a[10000]; bool isfunc(int x){ //是否为不重复数 int i=0; &...
P1276
数字反转 题解:STL大法好
jsd
回复 0
|
赞 1
|
浏览 99
#include<bits/stdc++.h> using namespace std; int main() { int m, n; while(cin>>m>>n) ...
P1283
通俗解释
123456608
回复 0
|
赞 1
|
浏览 104
//1283-Pre-Post #include<bits/stdc++.h> using namespace std; int zh(int m,int n){ if(m==0) return 0; int fenzi=1; int fenmu=...
P1036
三个数的最大值 题解:
2024上岸
回复 2
|
赞 4
|
浏览 800
#include<iostream> #include<algorithm> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; cout<<...
P1564
石油储藏 (dfs)题解:
我与代码的故事
回复 0
|
赞 0
|
浏览 81
#include<bits/stdc++.h> using namespace std; const int N = 110; char g[N][N]; bool st[N][N]; int n, m, cnt; void dfs(int x, int y...
P1013
判断素数 题解:
赖建霖
回复 0
|
赞 0
|
浏览 89
多用递归思想 #include <bits/stdc++.h> using namespace std; //素数判断函数 int Boolprimenumber(int a){ if(a<2) &nbs...
P1311
继续畅通工程 题解:求助sos,为何通过率只有80%
zcq107
回复 1
|
赞 1
|
浏览 148
使用克鲁斯卡尔算法,输入过程中,当s==1时,直接合并,使用sort按权值从小到大排序,然后依次取出权值最小且没有修建的边,权值累加,有什么问题,求解答? #include<bits/stdc++.h> using namespace std; const i...
P1257
P1257 最大上升子序列和 答疑提问:
jsd
回复 1
|
赞 2
|
浏览 92
可以帮忙看看这个错在哪里了嘛,通过率14%,一直没想明白错在哪里,题号1257 #include<bits/stdc++.h> using namespace std; int a[1001]; int main() { ...
P1374
找最小数(sort函数) 题解:
我与代码的故事
回复 0
|
赞 1
|
浏览 105
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> PII; const int N = 1010; PII s[N]; int n; bool cmp(PII ...
P1265
八皇后 题解:无敌简短且易于理解的代码
zcq107
回复 0
|
赞 1
|
浏览 107
题目要求输出第t个串,则每次递归到n=8时,令t--,当t==0时,输出path所保存的路径。从第一行开始搜索,直到搜索完8行为止。搜索完8行,且是刚好第k次搜索完8行,则将路径打印出来并返回。下一轮搜索完8行,会让t再次减一,达到-1,此时可以做一个剪支,当t小于0时直接返回。 #...
P1610
于是他错误的点名开始了 题解:
Union780
回复 1
|
赞 1
|
浏览 120
#include<iostream> #include<string> #include<map> using namespace std; int main() { int n, M; string s; while (cin >...
P1404
成绩排序(函数sort) - 华科 题解:
我与代码的故事
回复 0
|
赞 2
|
浏览 101
#include<bits/stdc++.h> using namespace std; const int N = 1010; int n; struct student{ string name; int age; int score; }s[...
P1610
求教:为什么用map会WA呢
csYfZhang
回复 3
|
赞 1
|
浏览 8.7k
int main() { int n, M; string s; while (cin >> n) { map<string, int>m; for (int i = 0; i < n; i++) { cin >> s...
P1013
判断素数 题解:
jsd
回复 2
|
赞 2
|
浏览 140
#include<stdio.h> int main(){ int n; scanf("%d",&n); int flag=0; ...
P1013
【C语言】看了很多,感觉代码太麻烦,可以参考我的
Lucky_Bug
回复 1
|
赞 8
|
浏览 14.1k
#include<stdio.h> int zhishu(int n) { int i; if(n<2) return 1; for(i=2;i<n;i++) { if(n%i==0) return 1;//非质数 }...
P1626
上交2018 Problem A 情景模拟
123456608
回复 0
|
赞 1
|
浏览 144
#include<bits/stdc++.h> using namespace std; // //寻找n!中质因子5的个数,用for循环还是太慢,超时 //换个思路,含有质因子5的数一定是5的倍数, //质因子有一个5的数是5的倍数, 质因子有两个5的数...
P1086
采药(01背包) 题解:
我与代码的故事
回复 0
|
赞 1
|
浏览 133
#include<bits/stdc++.h> using namespace std; const int N = 1010; int t[N], w[N], dp[N]; int T, m; int main() { cin >> T &...
P1281
计算表达式 先构造出后缀表达式,再计算后缀表达式
123456608
回复 0
|
赞 0
|
浏览 96
//10:38 //1281-计算表达式 #include<bits/stdc++.h> using namespace std; int charToint(char c[100],int n){ int s=0; // cout<<"c="<...
P1284
整除问题 题解:
123456608
回复 0
|
赞 3
|
浏览 123
#include<bits/stdc++.h> using namespace std; //质因子在本题中的作用要搞清楚,就是,如果a/b能整除,那么b的质因子一定是a的质因子的子集。 //若a=a1*a2*a3*...*an,那么a的质因子就是a1、a2、...、an...
P1563
迷宫 题解:
zcq107
回复 0
|
赞 1
|
浏览 117
注意每次输入都要对两个数组进行初始化操作memset,同时可以防止数组越界。 #include<bits/stdc++.h> using namespace std; const int N = 105; char g[N][N]; int d[N][N]; ...
P1098
前缀字符串 题解:
zcq107
回复 2
|
赞 1
|
浏览 146
求助为何这样通过率为0,根据所有的字符串构造一棵Trie树,利用深度优先遍历寻找Trie树叶子节点的个数。由于示例“kdfa”是“kdfa”的前缀,故统计到叶子节点时,只有cnt[p]==1时才将该字符串统计进去,避免了相同字符串的统计。测试用例...
P1209
刷出一道墙 题解:
zcq107
回复 0
|
赞 1
|
浏览 101
无敌简短的代码,差分数组的应用,初始数组每个元素值为0,每次刷给出起点和终点,只需修改差分数组即可,最后累加起来其实每个点刷的次数,需要使用scanf和printf作为输入输出减少时间。(参考了上的模板) #include<bits/stdc++.h> ...
P1175
剩下的树 题解:
zcq107
回复 0
|
赞 0
|
浏览 133
用一个set保存0到L上所有的位置即可,移走树,则从set中移走对应的位置,最后输出set的大小。 #include<bits/stdc++.h> using namespace std; int main(){ int l,m; whil...
P1176
十进制和二进制 题解:纯粹的c语言解法
Y969432769845
回复 0
|
赞 2
|
浏览 134
不使用其他题解的各种什么余数什么商什么逆置函数什么容器什么动态开辟数组,纯粹的c语言加cin和cout,模拟硬件求解,100%AC。 #include <bits/stdc++.h> using namespace std; int main() { &nb...
P1161
二叉树遍历 题解:
zcq107
回复 2
|
赞 3
|
浏览 218
为何这么写,测试用例可以在本地ide正确运行,但是在平台上现实runtime,没有检查出问题,求解答 #include<bits/stdc++.h> using namespace std; struct btnode{ char data; ...
P1817
成绩再次排序 题解:
zhizhuo_1
回复 1
|
赞 1
|
浏览 105
66%不知道错在什么地方,希望有人帮忙看看,谢谢 #include <bits/stdc++.h> using namespace std; string s[105]; struct student{ string name; int yu...
P1296
括号匹配问题 题解:
zcq107
回复 0
|
赞 1
|
浏览 123
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ stack<int> st; ...
P1057
数字模式的识别 题解:最简单暴力的做法
固态氧化碳
回复 0
|
赞 1
|
浏览 97
这应该是最容易想到的了 直接暴力解 把出现的数字存入数组 然后从小到大遍历找最大值 #include <stdio.h> #include <iostream> using namespace std; int count[2000000]={0...
P1565
最短路 (朴素Dijkstra)题解:
我与代码的故事
回复 0
|
赞 3
|
浏览 153
稠密图用朴素Dijkstra算法,用链式前向星存储图 #include<bits/stdc++.h> using namespace std; const int N = 110; int g[N][N]; int dist[N]; boo...
P1317
用顺序存储二叉树的方法建树再进行比较
123456608
回复 0
|
赞 1
|
浏览 133
//二叉搜索树 //思路1:先根据第一个序列构造出二叉搜索树,再遍历剩下的序列 (麻烦) //思路2:对于任意小于a[0]的两个数字,但凡它们在两个序列中的前后顺序不一样,就会构造成两个二叉树 (有漏洞,错误) //思路3:反正就十个结点,最多十层,设置一个int a[2048];&nb...
P1012
字符移动 题解:
MEGURI
回复 0
|
赞 2
|
浏览 176
#include<stdio.h> int main() { int i = 0; int j = 0; int k = 0; &n...
P1010
排序 题解:拆分数组分别进行冒泡排序输出
MEGURI
回复 0
|
赞 2
|
浏览 175
#include<stdio.h> int main() { int n = 0; scanf("%d", &n); int ...
P1551
判断二叉树是否对称 题解:无需建树
123456608
回复 0
|
赞 3
|
浏览 166
思路:将每一层结点单独保存在string b 中,再依次判断b是否对称 #include<bits/stdc++.h> using namespace std; //1551-判断二叉树是否镜像对称 bool isduichen(string &...
P1175
剩下的树(差分) 题解:
我与代码的故事
回复 0
|
赞 1
|
浏览 140
#include<bits/stdc++.h> using namespace std; const int N = 1e4 + 10; int n, m; int b[N]; int main() { while(cin >> n) ...
P1478
喝饮料 题解:正确率只有60%,请大佬帮忙康康哪里错了哇
123456608
回复 2
|
赞 5
|
浏览 230
正确率只有60%,请大佬帮忙康康哪里错了哇 #include<bits/stdc++.h> using namespace std; typedef struct{ float wi; &nbs...
P1394
统计单词 题解:
zhizhuo_1
回复 0
|
赞 2
|
浏览 152
#include <bits/stdc++.h> using namespace std; //不用动脑子的暴力解法,实际上就是依次统计进一个数组中输出 int main(){ string s; getli...
P5104
约瑟夫问题的实现 题解:
我爱陈少熙
回复 0
|
赞 0
|
浏览 115
#include <bits/stdc++.h> using namespace std; int main() { int n, k; cin >> n >> k; // 输入 n 和 k vector<...
P1185
全排列 题解:迭代方式生成全排列
MEGURI
回复 0
|
赞 1
|
浏览 160
#include <stdio.h> #include <string.h> // 交换两个字符 void swap(char *x, char *y) { char temp = *x; &n...
P1043
计算Sn 题解:
MEGURI
回复 0
|
赞 11
|
浏览 217
#include <stdio.h> int main() { int a, j; scanf("%d %d", &a, &j); &n...
P1841
南京理工-树的高度 题解:
Zyc_nj
回复 0
|
赞 0
|
浏览 116
#include<bits/stdc++.h> using namespace std; const int N=100010; int h[N],e[N],ne[N],indx,dist[N]; int visit[N]; int n,m; //根编号是m ...
P1011
P1011 日期 答疑提问:
xidianshangan
回复 1
|
赞 1
|
浏览 186
benben 本地跑答案没问题,但是在这个上面跑答案就不一样 很奇怪
我要提问
全站热榜
1
无法正确通过题目都是哪些原因造成的?
2
机试如何才能快速提高?
3
N诺成就值出炉,帮你一眼识别大神
4
[置顶]计算机考研择校分析【25考研必读】
5
【23计算机考研】39所985院校录取分数线汇总
6
A+B问题 题解:C
7
【2023计算机考研】211院校录取分数线汇总
8
详细题解(站在巨人的肩膀上)
9
负二进制 题解:
10
题目难点:数学公式不断化解