首页
DreamJudge
院校信息
考研初试
考研复试
保研专区
讨论区
兑换中心
登录
注册
上岸
P1310
奥运排序问题 题解:
ottata
思路:有多少个比自己大的(如m),自己排序第m+1。 #include <bits/stdc++.h> using namespace std; struct country { int gold, award, people; double ...
P1642
字符串区间翻转 题解 有一个小细节漏掉了,全1的情况吐了喵:
liux662
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; string s; while (cin >> n >&...
P2017
上升序列 题解:
Ranz
#include<bits/stdc++.h> using namespace std; int find(vector<int> &nums){ int n = nums.size();  ...
P1255
字符串排序2 题解:
winner748
#include<bits/stdc++.h> using namespace std; bool cmp(char a,char b){ char c1 = tolower(a); char c2 = tolow...
P1678
走路还是坐公交 题解,感觉逻辑挺清晰喵:
liux662
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 9; int mp[N]; bool vis[N]; bool inmp(int x) { if(x < 1 || x &...
P1456
图的连通分支数 用set很方便喵题解:
liux662
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 9; int fa[N]; bool vis[N]; int find(int x) { if(x == fa[x]) retu...
P1454
反序数 题解:
十廿六
直接找到符合条件的这个数了…… 9倍,所以千位只能是1,个位自然就是9,然后十位上了0,发现个位进的8太大了,百位会进上去,所以十位又从9往下,9不对,又试了8,发现1089正好 #include<bits/stdc++.h> using ...
P1180
最简真分数 题解:c++,不想记公式就自己推,也挺简单
bro
#include <bits/stdc++.h> using namespace std; //求最大公约数 int gcd(int x,int y){ if(x > y) swap(x,y); for(i...
P1975
极大连通图个数 BFS方法的题解模板喵:
liux662
#include<bits/stdc++.h> using namespace std; int dx[8] = {-1, 1, 0, 0, -1, 1, -1, 1}; int dy[8] = {0, 0, -1, 1, -1, -1, 1, 1}; const in...
P5218
堆栈基本操作 题解:
liux662
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; stack<int> stk; vector<pair<string,...
P1281
计算表达式 题解:
liux662
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); string s; while(cin >> s) ...
P1675
机器人走迷宫 题解:模拟
formulaunifyx
#include<bits/stdc++.h> using namespace std; const int maxn=15; char mpt[maxn][maxn]; int flag[maxn][maxn]; int dir[4][2]={{-1,0},{0,1},...
P1032
变位词 题解:
dxuxu
受到另一个题解的启发,将字符串排序后直接比较是否相等(无比简洁) #include<bits/stdc++.h> using namespace std; string str1; string str2; int main(){ int n; ...
P1940
最大递增子序列和 题解:
yauqq
#include <bits/stdc++.h> using namespace std; int dp[1001], a[1001], n; int LIS_nn() { int ans = 0; for (int i = 1; i <...
P1895
子序列 题解:
yauqq
#include <bits/stdc++.h> using namespace std; // 计算两个字符串的LCS长度(滚动数组优化空间) int lcsLength(const string& s, const string& t) { ...
P1874
最长公共子序列LCS 题解:
yauqq
#include <bits/stdc++.h> using namespace std; int main() { string s1, s2, s3; while (cin >> s1 >> s2 >&...
P1826
复旦-最大连续子序列 题解:
yauqq
#include <bits/stdc++.h> using namespace std; int main() { int k; while (cin >> k) { vector<int> a(k...
P1571
最长连号 题解:
yauqq
#include <bits/stdc++.h> using namespace std; int main() { int k; while (cin >> k) { vector<int> a(k...
P1394
统计单词 题解:
曾不会
while(1): try: iin=input() ll=len(iin) nn=iin[:ll-1] s = list(map(str, nn.split())) l = len(s) ...
P5278
找出字符串的最长回文子串 题解:
曾不会
#include<bits/stdc++.h> using namespace std; int n; int fun(const string& s,int left,int right) { while(left>=...
P1475
大整数乘法 题解:
岸上的乌龟
一开始用的char ans数组,通过率只有83,惊奇的发现acsii码值最大到127,所以一定要用int数组! #include<bits/stdc++.h> using namespace std; int main() { int le...
P4215
二叉树的后序序列 题解:
Ranz
#include<bits/stdc++.h> using namespace std; typedef struct node{ char data; struct node *lchild, *rchild; }*BitTree; ...
P1664
中南 - 最大连续子序列 题解:
yauqq
#include <bits/stdc++.h> using namespace std; int main() { int k; while (cin >> k) { vector<int> a(k...
P1737
骑车路线 题解:
yauqq
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin >> n){ vector<int> dp(n); for...
P1562
哈夫曼编码 题解:非叶节点累加和 = WPL
langlang23
注意点: 思路:定义 priority_queue ,修改为小顶堆,遍历字符,map记录不同字的出现次数(权重),权重输入到 queue中,其中非叶节点的和,就是哈夫曼编码的长度。 推导: AAAAABCD = 5 1 1 1 = 1 1 1 5, (...
P1317
二叉搜索树 题解:建立二叉树,都前序遍历输出成字符串,strcmp比较是否相同
滴滴答答302
#include <stdio.h> #include <string.h> #include <stdlib.h> typedef struct node{ int data ; &...
P1905
整数排序 题解:vector + sort + 自定义排序给规则
ryuki
#include <iostream> #include <vector> #include <algorithm> using namespace std; int getlen(int num) { i...
P1733
成绩排序 - 西电 题解:自定义sort的排序规则
ryuki
#include <iostream> #include <cstdio> #include <vector> #include <string> #include <algorithm> using namespace s...
P1307
组队刷题 题解:
litery
#include <bits/stdc++.h> using namespace std; struct timu{ int w; int m; double xiaolv; bool operator <(const ...
P1307
组队刷题 题解:为什么不对 我这个struct就多定义了一个 就只能ac20%
08193003
#include<bits/stdc++.h> using namespace std; struct bankuai{ double a; double b; double c=b/a; }aa[1005]; bool cmp(bankuai a1,...
P1478
喝饮料 题解:c++
bro
#include <bits/stdc++.h> using namespace std; struct Drink{ int volume; int price; double pe...
P1383
查找第K小数 题解:set
litery
#include <bits/stdc++.h> using namespace std; int main(){ int n,t; while(cin>>n){ set<int> st; ...
P1035
简单背包问题 题解:
奶龙大王
25正确率DFS+剪纸 #include <iostream> #include <map> #include <cctype> // for isalpha, tolower #include <string> #i...
P1347
To Fill or Not to Fi 题解:
18200554684
写在前面(因为后面不好加) 这个答案非我原创,是我穷途末路的时候,看到一个写得很和我胃口的答案,研究了一两天写出来的个人理解,我个人也是菜狗子,如有不足,欢迎指正。 正文 这是一个很容易看出来要用贪心(bushi)但是很难想具体的贪心策略的题目(主要是我经验不足,没有看懂解题...
P1007
整除 题解:
666705
#include<stdio.h> int main(){ int num=0; for(int i=100;i<=1000;i++){ if(i%5==0&&i%6==0){ if(num==9){ printf("%d...
P1007
整除 题解:
666705
#include<stdio.h> int main(){ int num=0; for(int i=100;i<=1000;i++){ &n...
P1007
整除 题解:
666705
#include<stdio.h> int main(){ int num=0; for(int i=100;i<=1000;i++){ &n...
P1007
整除 题解:
666705
#include<stdio.h> int main(){ int num=0; for(int i=100;i<=1000;i++){ &n...
P1284
整除问题 题解:
岸上的乌龟
#include <bits/stdc++.h> using namespace std; int prime[1000]= {0}; void getprime() { prime[1]=1; for(int i...
P1730
最长连续公共子序列 题解:
yauqq
#include<bits/stdc++.h> using namespace std; int dp[105][105]; int main(){ string a, b; while(cin >> a >> b)...
P1177
查找学生信息 题解:
litery
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; while(cin>>N>>M){ map<int,int> ...
P1281
计算表达式 题解:
18919717626
双zai的思路,感觉挺繁琐 #include<bits/stdc++.h> using namespace std; int priority(char a){ if(a=='+'||a=='-') ...
P1731
最长公共子序列 题解:
yauqq
#include<bits/stdc++.h> using namespace std; // dp[i][j] 表示:字符串a的前i个字符 和 字符串b的前j个字符 // 的最长公共子序列长度 int dp[1005][1005]; int main(){ ...
P800
活动安排 题解:贪心
快乐小土狗
#include <bits/stdc++.h> using namespace std; int n; struct node { int st, ed; } a[1005]; bool cmp(node x, node y) { return ...
P801
种树2 题解:贪心
快乐小土狗
#include <iostream> #include <algorithm> using namespace std; int l[30005], ans; struct sug { int b, e, t; } su[5005]; boo...
P802
喷水装置 题解:贪心
快乐小土狗
#include <bits/stdc++.h> using namespace std; int n, cnt, L, h, x, r; struct node { double x, y; } a[200005]; bool cmp(node a, no...
P1293
Coincidence 题解:
yauqq
#include<bits/stdc++.h> using namespace std; // dp[i][j] 表示:字符串a的前i个字符 和 字符串b的前j个字符 // 的最长公共子序列长度 int dp[105][105]; int main(){ st...
P803
Best Cow Fences 题解:二分
快乐小土狗
#include <bits/stdc++.h> using namespace std; int n, L; vector<int> A; // 判断平均值 mid(已 ×1000)是否可行 bool check(int mid) { ...
P1338
EXCEL排序 题解:
litery
#include <bits/stdc++.h> using namespace std; struct stu{ string no; string name; int score; }; bool compare_1(stu a,s...
P1176
十进制和二进制 题解:居然写了一下午
牧濑
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace ...
1
2
我要提问
全站热榜
1
无法正确通过题目都是哪些原因造成的?
2
[置顶]计算机考研择校分析【25考研必读】
3
机试如何才能快速提高?
4
题目难点:数学公式不断化解
5
【25计算机考研】39所985院校录取分数线汇总
6
A+B问题 题解:C
7
逻辑很简单,但是实现却要小心多多
8
【23计算机考研】39所985院校录取分数线汇总
9
计算机/软件学校排名!全国第五轮学科评估结果
10
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值