首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1221
旋转矩阵 题解:C++ 本题有很多小注意点
苍灵
回复 1
|
赞 1
#include<bits/stdc++.h> using namespace std; int n,m,k,a[150][150]={0},b[100]={0}; //需要注意使用引用传值 void change1(int &n,int &m,...
P1043
计算Sn 题解:
小雨910
回复 0
|
赞 0
Sn=2+22+222+2222+2222 =>Sn=2+[20+2]+[220+2]+[2220+2]+[22220+2] =>Sn=a+前一项*10+a 这里共有五个数,除了第一项,所以循环四次,但是我们发现,第一项也可...
P1216
旋转方阵 题解:C++ 需要注意结果的输出格式
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ int n,index=1,a[30][30]={0}; cin>>n; int left=0,right=n-1,top=0,bo...
P1377
旋转矩阵 - 北航 题解:C++ 关键在于顺时针旋转90度的公式
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; //矩阵旋转90度的函数;需要注意的是其余的180度和270度可通过多次调用这个函数来达到相同的效果;对于0度的话直接判断是否 //与原矩阵相同即可 void change(i...
P1307
组队刷题 题解:为什么不对 我这个struct就多定义了一个 就只能ac20%
08193003
回复 4
|
赞 6
#include<bits/stdc++.h> using namespace std; struct bankuai{ double a; double b; double c=b/a; }aa[1005]; bool cmp(bankuai a1,...
P1392
杨辉三角形 - 西北工业大学 题解:C++ 解法不严谨,没有写递归函数
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int num[300][300]={0}; for(int i=2;i<...
P1062
杨辉三角形 题解:C++ 利用数组
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n&&n!=0){ int num[30][30]={0}; if(n=...
P1473
字符棱形 题解:C++ 找循环规律
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ for(int j=0;j<n-i;j...
P1422
进制转换3 题解:C++ 80%通过率的看这里
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int m,n; string s; cin>>m>>n; cin>>s; if(m==n){ ...
P1380
二进制数 题解:C++
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ unsigned int n; while(cin>>n){ int num[100],index=0; while(n!=...
P1368
排列与二进制 题解:不需要大数,需思考
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin>>n>>m&&(n!=0&&m!=0)){ in...
P1259
进制转换2 题解:C++ 懒人写法
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int res=0,m; for(int i=s.length()-1;i...
P1178
进制转换 题解:C++ 可主要分为两步:1.大数对2取余;2.大数除以2
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; bool isZero(int a[],int len){ for(int i=0;i<len;i++){ if(a[i]!=0){ return fals...
P1097
负二进制 题解:C++
苍灵
回复 0
|
赞 2
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int m; string s; if(n==0){ cout&l...
P1668
数字 题解:C++ 利用数组巧解
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int num[10]={0}; for(int i=0;i<s.l...
P1667
容易的题 题解:C++
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int a=0,b=0,c=0,d=0; for(int i=0;i<...
P1176
十进制和二进制 题解:帮忙看看为什么通过率只有50%嘞
winwin131
回复 1
|
赞 0
#include<stdio.h> #include<string.h> int main() { long long dec1; while (scanf("%ld", &dec1) != EOF) { long long dec2 ...
P1212
平方和与立方和 题解:题中说了32位整数即可,所以可以使用int
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int m,n; while(cin>>m>>n){ if(m>n){ swap(m,n); } ...
P1038
成绩的等级 题解:C++
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; if(n>=90){ cout<<"A"<<endl; }el...
P1085
校门外的树 题解:C++
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,a[100][2],num[10001]={0}; cin>>n>>m; for(int i=0;i&l...
P1348
百鸡问题 题解:50%正确率的,看看写没写while(cin>>n)
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ for(int x=0;x<=n/5;x++){ for(int y=0...
P1045
平方和与倒数和 题解:C++
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; //求和 int sumH(int n){ int sum=0; for(int i=1;i<=n;i++){ sum=sum+i;...
P1735
统计卡牌的值 题解:C++
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int n,sum=0; cin>>n; for(int i=0;i<n;i++){ string s; cin&...
P1500
求S(n) 题解:费马小定理
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ long long n; while(cin>>n){ cout<<n%3<<endl; } re...
P1034
水仙花数 题解:C++
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int sumG(int a){ int sum=0; while(a!=0){ sum=sum+pow(a%10,3); a=a/10; } retu...
P1003
翻转数的和 题解:C++
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; //定义翻转函数(实现了翻转之后去掉最前面的0) string fanzhuan(string s){ string s1,s2; int n; for(int ...
P1428
整数和 题解:C++
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ int m; cin>>m; int num[100]; for(int i=0;i<m;i++){ cin>...
P1722
身份证校验 题解:C++ 数组
苍灵
回复 0
|
赞 1
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int num[17]={7,9,10,5,8,4,2,1,6,3,7,9,10...
P1040
利润提成 题解:
苍灵
回复 0
|
赞 0
#include<bits/stdc++.h> using namespace std; int main(){ long long sum,res=0; cin>>sum; while(sum>100000){ if(sum>...
P5226
错位排列 题解:
Yelson
回复 0
|
赞 0
不会数学,只会回溯。 #include<bits/stdc++.h> using namespace std; int n; vector<vector<int>>ans; void bt(vector<int>& ...
P1726
不连续1的子串 题解:
Yelson
回复 0
|
赞 1
离散数学的东西忘了,写篇题解来增强下记忆。 记f(n)为长度为n的不含连续1的串的个数, 若末尾(从1计数,第n位)为0,则第n-1位可以是1,也可以是0,共有f(n-1)种情况; 若末尾为1,则第n-1位必然为0(不能有连续的1),此时第n-2位可以是1,也可以是0,共有f...
P1035
简单背包问题 题解:01背包的特殊化,价值和重量是1:1
leo110
回复 0
|
赞 0
#include<iostream> #include<cstring> using namespace std; int dp[1001][1001];//dp数组里存重量,利用01背包解题,只不过这里的价值和重量是1:1 int w[1001]; ...
P1023
IP地址 题解:合法情况很好考虑,不合法的情况一大堆
leo110
回复 0
|
赞 2
#include<iostream> #include<sstream> #include<algorithm> #include<map> using namespace std; //int->char用map实现&nbs...
P1172
最大序列和 题解:dp的核心:吸收or重构
leo110
回复 0
|
赞 1
#include<iostream> using namespace std; typedef long long ll; int main() { int n; while(cin>>...
P1133
求1到n的和 题解:
大了个西瓜
回复 0
|
赞 0
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int...
P1133
求1到n的和 题解:
大了个西瓜
回复 0
|
赞 0
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int...
P1133
求1到n的和 题解:
大了个西瓜
回复 0
|
赞 0
//求1到n的和 #include<stdio.h> int main(){ int n; scanf("%d",&n); int...
P1261
字符串排序3 题解:求长度真就是length啊?这不对吧?
leo110
回复 0
|
赞 0
#include<iostream> #include<vector> #include<algorithm> #include<sstream> using namespace std; struct STR{ &n...
P1348
百鸡问题 题解:
leo110
回复 0
|
赞 0
#include<iostream> #include<vector> #include<algorithm> using namespace std; //提高时间复杂度的代价就是牺牲空间复杂度来排序 //加速为O(n2),不加速则是...
P1294
后缀子串排序 题解:字符串切片+vector
leo110
回复 0
|
赞 0
#include<iostream> #include<vector> #include<string> #include<algorithm> using namespace std; void StrSort(const str...
P1000
A+B问题 题解:
雨晴
回复 0
|
赞 2
A,B=map(int,input().split()) print(A+B)
P2012
堆排序 题解:
XCR553
回复 0
|
赞 0
#include <bits/stdc++.h> using namespace std; void adjustHeap(int* arr, int n, int i){ int mx = i; &n...
P1033
细菌的繁殖 题解:
XCR553
回复 0
|
赞 1
什么动态规划,一个等差数列求和罢了,不知道其他题解搞那么复杂干什么 #include <bits/stdc++.h> using namespace std; int main() { int N, n; &nb...
P1109
二叉树的建立和遍历 题解:只看题注,没看输出要求,所以把二叉树的相关功能几乎都写
leo110
回复 0
|
赞 1
#include<iostream> #include<string> #include<queue> #include<vector> #include<algorithm> using namespace std; ...
P1501
括号匹配 题解:
leo110
回复 0
|
赞 0
//1067题的代码稍微改一点就行。主要两点不同:①只有两个类型的括号②括号没有优先级 //解题思路:map映射字符为整数,结合数据结构的stack进行括号匹配。 #include<iostream> #include<map> #include&l...
P1067
括号的匹配 题解:"{{}}"这种平级括号内嵌也行!!!
leo110
回复 0
|
赞 1
//解题思路:map映射字符为整数,结合数据结构的stack进行括号匹配。 #include<iostream> #include<map> #include<stack> using namespace std; map<c...
P1161
二叉树遍历 题解:
leo110
回复 0
|
赞 3
#include<iostream> using namespace std; typedef struct node{ char data; struct node *lchild...
P1025
链表合并 题解:只为锻炼手搓链表以及合并链表,代码越长就越容易出一些小问题,因此
leo110
回复 0
|
赞 0
#include<iostream> using namespace std; struct Node{ int data; struct Node *next; }; struct N...
P1022
删除最大最小数 题解:
leo110
回复 0
|
赞 0
#include #include #include using namespace std; pair delemm(const vector& a){ int min= *min_element(a.begin(),a.end()...
P1286
最短路径 题解:
XCR553
回复 1
|
赞 1
Dijkstra+大数模拟 #include <bits/stdc++.h> using namespace std; struct Edge{ int u,v; string w; }...
1
2
我要提问
全站热榜
1
无法正确通过题目都是哪些原因造成的?
2
机试如何才能快速提高?
3
题目难点:数学公式不断化解
4
[置顶]计算机考研择校分析【25考研必读】
5
逻辑很简单,但是实现却要小心多多
6
A+B问题 题解:C
7
1017 幂次方 快速幂模板
8
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
9
【25计算机考研】39所985院校录取分数线汇总
10
日期 题解: