主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1000
A+Bproblem (c++)<----抓换的思想
jerry3128
回复 7
|
赞 2
|
浏览 14.5k
这道题是我在本站上A的第一道题,那我们直接开始吧: 首先,我们要用到转换的思想,既然这道题跟代数有关,那我们便可以把它转换为图论,如图: 又因为在题目的数据中并没有负数,那么,显然这个问题就转化为了求源点S到汇点T的最大流,接着就是模板就行了 #include<bits...
P1014
加密算法 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 90
#include<bits/stdc++.h> using namespace std; int main() { string str; getline(cin, str); for(int i = 0; i < str....
P1013
判断素数 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 63
#include<bits/stdc++.h> using namespace std; int n; bool cheak(int n) { if(n == 1) return false; for(int i = 2; i * i &l...
P1023
IP地址 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 60
#include<bits/stdc++.h> using namespace std; char num[1010]; bool cheak(string str) //判断合法性 { int cnt = 0, sum = 0; for(int i ...
P1011
日期 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 79
#include<iostream> using namespace std; string w[8] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", ...
P1012
字符移动 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 48
#include<bits/stdc++.h> using namespace std; int main() { string str, num, ot; cin >> str; for(int i ...
P1010
排序 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 43
#include<bits/stdc++.h> using namespace std; const int N = 1010; int a[N]; int n; int main() { cin >> n; fo...
P1008
0和1的个数 (位运算)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 69
#include<bits/stdc++.h> using namespace std; int n, cnt; int main() { cin >> n; while(n) { if(n & 1) cnt ++; ...
P1007
整除 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 67
#include<bits/stdc++.h> using namespace std; int cnt; int main() { for(int i = 100; i <= 1000; i ++) { if(i %...
P1006
字符串翻转 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 76
#include<bits/stdc++.h> using namespace std; int main() { string s; getline(cin, s); reverse(s.begin(), s.end...
P1377
旋转矩阵 - 北航 题解:
flipped
回复 0
|
赞 0
|
浏览 129
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h>...
P1018
击鼓传花 题解:
flipped
回复 0
|
赞 0
|
浏览 127
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h>...
P1062
杨辉三角形 题解:
flipped
回复 0
|
赞 0
|
浏览 95
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h>...
P1334
最大连续子序列 题解:
为欢几何
回复 0
|
赞 0
|
浏览 132
#include<bits/stdc++.h> using namespace std; long long dp[1000010]; long long a[1000010]; long long maxx; long long s = 0, d = 0; lon...
P1098
前缀字符串 有大佬可以帮忙看一下错在哪里吗?
等等
回复 2
|
赞 0
|
浏览 196
#include<bits/stdc++.h> using namespace std; bool compair(const string& s1, const string& s2){ if (s1.size() > ...
P1655
北邮2019 最短路径 Floyd:wrong error50%
为欢几何
回复 1
|
赞 0
|
浏览 169
//Floyd模板 #include<bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3 const int maxn = 105; int mpt[maxn][maxn]; int edge[maxn...
P1176
十进制和二进制 50%通过率,有大佬可以帮忙看看吗
等等
回复 2
|
赞 0
|
浏览 216
#include<bits/stdc++.h> using namespace std; int main() { char a[200],buf[200]; int b[200]; &n...
P1333
开门人和关门人 题解:
mshj
回复 0
|
赞 0
|
浏览 132
#include<iostream> #include<algorithm> using namespace std; int main() { int n; while (cin >&g...
P2021
整数去重 题解:
sleepysilipu
回复 1
|
赞 0
|
浏览 117
一个暴力解,时间复杂度过高故通过不了评测。 思路:双重for循环,重复项标记为-1 #include<stdio.h> int main(){ int n,i,j; scanf(&...
P1563
迷宫 题解:AC
为欢几何
回复 2
|
赞 0
|
浏览 164
//迷宫问题求起点到终点的最短路径(自己写的代码) #include<bits/stdc++.h> using namespace std; struct node { int x; int y; &nbs...
P1082
Hanoi塔问题 题解:注意输出格式,相邻输出之间有3个空格
为欢几何
回复 0
|
赞 0
|
浏览 109
//汉诺塔输出每一个步骤,五个一换行 #include<bits/stdc++.h> using namespace std; int step;//记录移动步数 void Hanoi(int n, char a, char b, char c) { ...
P1417
八进制 题解:
Amberqwe
回复 2
|
赞 0
|
浏览 215
只有80%,为什么啊 #include<stdio.h> int main() { int n,x; int a[1000000]; int m=0; &nb...
P1562
哈夫曼编码 题解:通过率50%,哪种情况没考虑到呢?
为欢几何
回复 2
|
赞 0
|
浏览 131
//输出字符串最佳无前缀可变长度编码的位长度 #include<bits/stdc++.h> using namespace std; int main() { string s; while(cin >&...
P996
二叉搜索树 - 复旦2020 题解:Time Limit Exceeded 90
为欢几何
回复 3
|
赞 0
|
浏览 168
#include<bits/stdc++.h> using namespace std; int temp[100001]; struct Tree { int data; struct Tree* lchild; struct Tree* ...
P5131
多种排序 题解:
Qweas
回复 0
|
赞 0
|
浏览 91
#include <iostream> #include <vector> #include <algorithm> // 直接插入排序 void insertionSort(std::vector<int>& arr) ...
P1382
哈夫曼树 题解:最简单易懂的思路,AC
为欢几何
回复 2
|
赞 0
|
浏览 170
//哈夫曼树,输出所有结点的值与权值的乘积之和 #include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n) { int ...
P1221
旋转矩阵 题解:
yangke
回复 0
|
赞 0
|
浏览 113
#include <iostream> #include <algorithm> using namespace std; int n, m, k; int manu; int res[101][101]; int a[101][101]; int mai...
P1047
分数求和 题解:规律就是a是a+b,b是上一次的a,注意要用double或者fl
RingoCrystal
回复 0
|
赞 0
|
浏览 118
#include <bits/stdc++.h> using namespace std; double sumAns(int N) { double sum = 0; double a = 2, b = 1; // 初始的前两项 for ...
P1031
判断是否是整数 题解:3.000算整数
RingoCrystal
回复 0
|
赞 0
|
浏览 116
#include <bits/stdc++.h> using namespace std; int main(){ string s; while(cin>>s){ int flag=0; int tag=0; for(int i=...
P1045
平方和与倒数和 题解:如何获得float,很简单1.0/i
RingoCrystal
回复 0
|
赞 0
|
浏览 109
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; float ansa=0; for(int i=1;...
1
2
3
4
5
...
126
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇