主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1422
进制转换3 题解:
Pstary
VIP
回复 0
|
赞 0
|
浏览 746
#include<stdio.h> #include<string.h> #define N 105 int main() { int n, m; //m是现在的进制,n是要转换的进制 char...
P1081
猴子报数 题解:
Qhovo
回复 0
|
赞 1
|
浏览 513
#include<stdio.h> #include<malloc.h> struct node{ int num; struct node *next; }; int n,s,m; struct...
P1566
确定比赛名次 题解:拓扑排序
snake
VIP
回复 0
|
赞 0
|
浏览 640
解题思路:拓扑排序裸题。所谓的拓扑排序就是将入度为0的节点编号入队(因题目要求输出编号小的队伍在前面,所以采用最小堆优先队列来维护条件),当队首元素出队时,依次以它为尾的弧的另一端节点入度减1,同样只要有节点的入度减完为0的就其入队,循环直至不存在无前驱的顶点。 当然此题不存在有向环,因...
P2022
蛇形填数 题解:
Qhovo
回复 0
|
赞 0
|
浏览 397
#include <stdio.h> int main(){ int m,n; while(scanf("%d%d",&m,&n)!=EOF){ ...
P1372
堆栈的使用 题解:C++ stack
Syou
回复 0
|
赞 0
|
浏览 705
C++ #include <iostream> #include <vector> #include <string> #include <stack> using namespace std; int main(){ i...
P1072
题解:相当于只有上下两个方向的迷宫问题
shirellen
回复 0
|
赞 2
|
浏览 648
#include <iostream> #include<vector> #include <string> #include <algorithm> #include <queue> #includ...
P1083
简单的求和 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 477
#include<bits/stdc++.h> using namespace std; int main(){ int a,n; int s=0;int h=0; cin>>a>>n; while(n--){ s=s*10+a;...
P1361
求最大值 题解:
活着的传奇
回复 1
|
赞 1
|
浏览 527
#include<bits/stdc++.h> using namespace std; int main(){ int a[10]; while(cin>>a[0]){ for(int i=1;i<10;i++) { ...
P1334
动态规划,使用变量保存字段和最大时的开始和结束索引
928上岸梦校!
回复 0
|
赞 2
|
浏览 702
#include <iostream> #include <vector> using namespace std; typedef long long ll; int main() { int k; while (cin >&g...
P1400
特殊排序 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 558
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n]; for(int i=0;i<n;i++){ ...
P1179
密码翻译 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 489
数组定为100真的只能通过百分之30,要1000才可以。 #include<bits/stdc++.h> using namespace std; int main(){ char s[1000]; while(gets(s)){ for(int i...
P1276
数字反转 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 538
#include<bits/stdc++.h> using namespace std; int fanzhuanshu(int n){ int s=0;int a; while(n>0){ a=n%10; s=s*10+a; n...
P1163
求最大最小数 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 401
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ int a[n]; for(int i=0;i<n;i++){ cin>...
P1590
快速排序 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 434
#include<bits/stdc++.h> using namespace std; int main(){ int n;cin>>n; int a[n]; for(int i=0;i<n;i++){ cin>>a[i]...
P1047
分数求和 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 474
#include<bits/stdc++.h> using namespace std; int main(){ float a,b;float s; int n;cin>>n; a=1;b=2;s=0; while(n--){ s+=b/a; ...
P1033
详细注释代码,使用前缀和和dp数组减少计算
928上岸梦校!
回复 0
|
赞 1
|
浏览 634
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; // 输入询问次数 vector<long long> dp(1001); ...
P1180
最简真分数 题解:C++ gcd
Syou
回复 0
|
赞 0
|
浏览 741
C++ #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int gcd(int...
P1034
水仙花数 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 706
注意输入输出格式问题,换行和输入不为 #include<bits/stdc++.h> using namespace std; int shuixianhua(int i){ int a,b,c; c=i%10; b=(i/10)%10; a=i/100;...
P992
第三题 - 复旦大学2021 题解:
jadeandlogic
回复 0
|
赞 1
|
浏览 540
动态规划背包思想求解 这道题可以利用背包思想。 首先x1,x2,x3,...,xn可以分为2个数组。 a1,a2,... 和b1,b2,... sum{a}+sum{b} = sum{x}而且 sum{a}-sum{b}=e,将两式相加得到sum{a} = (sum{x} +...
P1375
素数 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 477
#include<bits/stdc++.h> using namespace std; int issushu(int k){ int i; for(i=2;i<k;i++) { if(k%i==0){ return 0; ...
P1036
三个数的最大值 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 360
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; printf("%d",c>(a>b?a:b)?c:...
P1664
详细注释AC代码
928上岸梦校!
回复 0
|
赞 2
|
浏览 426
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { // 输入序列 vector<int> seq...
P1360
字符串内排序 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 416
#include<bits/stdc++.h> using namespace std; int main(){ char s[200]; while(scanf("%s",s)!=EOF){ int n=strlen(s); sort(s,s+...
P1615
多边形的面积 题解:C++ 鞋带公式
Syou
回复 0
|
赞 1
|
浏览 587
C++ S三角形=0.5∗((x1∗y2+x2∗y3+x3∗y1)−(y1∗x2+y2∗x3+y3∗x1)) 我们代个数进去试试 A:(0, 4) , B:(0, 0) ,...
P1254
字符串排序 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 496
#include<bits/stdc++.h> using namespace std; int main(){ char s[20]; while(scanf("%s",s)!=EOF){ int n=strlen(s); sort(s,s+n...
P1248
整数奇偶排序 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 335
存入数组然后排序,然后前后遍历就可以了。 #include<bits/stdc++.h> using namespace std; int main(){ int a[10]; while(cin>>a[0]>>a[1]>>a[...
P1044
阶乘和 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 344
#include<bits/stdc++.h> using namespace std; long long f(int n){ long long int s=0;long long int a; if(n==0) return 1; for(int i=1;i...
P1155
反序输出 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 429
#include<bits/stdc++.h> using namespace std; int main(){ char s[4]; while(scanf("%s",s)!=EOF){ for(int i=3;i>=0;i--){ ...
P1461
反序相等 题解:
活着的传奇
回复 0
|
赞 0
|
浏览 315
#include<bits/stdc++.h> using namespace std; int fanxushu(int i){ int b;int s=0; while(i>0){ b=i%10; s=s*10+b; ...
P1067
括号的匹配 题解:C++ <stack>
Syou
回复 0
|
赞 2
|
浏览 1.0k
C++ 分别考虑8种括号 #include <iostream> #include <string> #include <stack> using namespace std; bool isMatched(string str){ ...
1
...
52
53
54
55
56
...
126
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇