主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
发布
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1405
遍历链表 题解:c++ 头插法
huanghu
回复 0
|
赞 0
|
浏览 191
#include <iostream> #include <vector> #include<string> #include<malloc.h> #include<algorithm> using namespace ...
P1730
最长连续公共子序列 题解:Output Limit Exceeded
xjnotywlq
回复 0
|
赞 0
|
浏览 264
#include <stdio.h> #include <stdlib.h> int m,n; char s1[105],s2[105]; int dp[105][105]; int max1(int a,int b) { if(a>...
P1081
猴子报数 题解:循环链表
Śś
回复 0
|
赞 0
|
浏览 110
#include<iostream> using namespace std; struct Monkey { int Num; struct Monkey*Next; }; stru...
P1164
最小邮票数 题解:01背包
xjnotywlq
回复 0
|
赞 0
|
浏览 151
#include <stdio.h> #include <stdlib.h> int m,n; int a[105]; int dp[105][105]; int min(int a,int b) { if(a<=b)return a...
P1249
子串计算 题解:vector + struct + sort
damowanghwj
回复 0
|
赞 0
|
浏览 284
/*E - 子串计算*/ #include<bits/stdc++.h> using namespace std; struct Info{ string s; int num; Info(string s,int num) : s(s),n...
P1410
打印日期 题解:
Śś
回复 0
|
赞 0
|
浏览 137
#include<iostream> using namespace std; int days1[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};//闰年 int days2[13] = {0,31,28,31,30,31,3...
P1290
日期差值 题解:相对第一个日期当年第一天
Śś
回复 0
|
赞 0
|
浏览 160
/* 例如: 20190916 20240323 先计算第一个日期相对20190101的天数 再计算第二个日期相对20190101的天数 作差 +1 输出 //加减顺序可以调换 */ #include<iostream&g...
P1394
统计单词 题解:
林——sir
回复 0
|
赞 0
|
浏览 287
#include <bits/stdc++.h> using namespace std; int main() { string s; while (cin >> s) { &...
P1410
打印日期 题解:
ysl777
回复 0
|
赞 0
|
浏览 158
#include<bits/stdc++.h> using namespace std; int f[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; bool isLeapYear(int x){ ...
P1032
变位词 题解:先sort()排序再比较
遨游
回复 0
|
赞 0
|
浏览 172
#include <iostream> #include <string> #include <algorithm> using namespace std; bool judge(string s1,string s2){  ...
P5124
求S(n)的值 题解:快速幂
xiao_su
回复 0
|
赞 0
|
浏览 224
#include <iostream> using namespace std; typedef long long ll; int n; int qp(int a, int k, int p) { int res = 1 % p;...
P1176
java
testzzz666
回复 0
|
赞 0
|
浏览 161
import java.math.BigInteger; import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[]...
P1429
围圈报数 题解:求大佬给看看,为什么超时,且只能输出一组数字
孙某人
回复 3
|
赞 0
|
浏览 177
#include <iostream> #include <string.h> #include <math.h> #include <algorithm> using namespace std; /*typedef struct...
P1020
最长连续因子 题解:
gzulianxisheng
回复 0
|
赞 0
|
浏览 157
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; ...
P1422
进制转换3 题解:
flipped
回复 0
|
赞 0
|
浏览 342
#include <stdio.h> #include <string.h> int main() { int m, n; char x[1000]; char a[1000]; int j = 0; scanf("%d %d", &am...
P1658
上楼梯 题解:dp
xjnotywlq
回复 0
|
赞 0
|
浏览 99
#include <stdio.h> #include <stdlib.h> int n; int dp[10000005]; int main() { dp[1]=1; dp[2]=2; dp[3]=4; ...
P1029
骨牌铺方格 题解:dp
xjnotywlq
回复 0
|
赞 0
|
浏览 168
#include <stdio.h> #include <stdlib.h> int n; int dp[10000005]; int main() { dp[1]=1; dp[2]=2; dp[3]=4; ...
P1432
学生查询 题解:
孙某人
回复 0
|
赞 0
|
浏览 122
#include <iostream> #include <string.h> #include <math.h> #include <algorithm> using namespace std; typedef struct ...
P1176
十进制和二进制 题解:还是写不出来
渐鸿于陆
回复 2
|
赞 0
|
浏览 246
#include<stdio.h> #include<string.h> char s[1005]; int arr[1005]; int ans[5000]; int convert(int arr[],int ans[],int len){ ...
P1404
成绩排序 - 华科 题解:
fzh
回复 0
|
赞 0
|
浏览 144
#include<bits/stdc++.h> using namespace std; typedef struct Grade { string name; int year, grade; ...
P1474
大整数加法 题解:自用笔记(C语言)
zx142407789
回复 0
|
赞 0
|
浏览 197
#include<stdio.h> #include<string.h> #include<stdlib.h> void largeplus(char* s1, char* s2) { int len1 = strlen(s1); int ...
P1374
找最小数 题解:c++
huanghu
回复 0
|
赞 0
|
浏览 174
#include <iostream> #include <vector> using namespace std; struct minshu{ int x; int y; }; int main() { minshu m; ...
P1885
正整数分解质因数 题解:c语言求解
orderrr
回复 0
|
赞 0
|
浏览 118
#include <stdio.h> #include <math.h> int isZhi(int x) { int flag = 1; for (int i = 2; i <= sqrt(x); i++) { ...
P1394
统计单词 题解:n诺风格解法
1576684866
回复 0
|
赞 0
|
浏览 203
#include <cstdio> using namespace std; #include <string.h> #include <iostream> #include <stdlib.h> int main() {  ...
P1474
大整数加法 题解:用python投机取巧
yanmy
回复 0
|
赞 0
|
浏览 115
while True: try: a, b = map(int, input().split()) print(a + b) except: break
P1723
死神来了 题解:抽屉原理
damowanghwj
回复 0
|
赞 0
|
浏览 112
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m) { n = (n >>...
P1086
采药 题解:数组大小开的不好就会错OVO
xjnotywlq
回复 0
|
赞 0
|
浏览 137
#include <stdio.h> #include <stdlib.h> int t,m; int w[10000]; int v[10000]; int dp[1000][10000]; int max(int a,int b) { ...
P1338
简洁
yanmy
回复 0
|
赞 0
|
浏览 231
#include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; struct Student { ...
P1035
简单背包问题 题解:dp
xjnotywlq
回复 0
|
赞 0
|
浏览 327
#include <stdio.h> #include <stdlib.h> int s,n; int w[1000]; int dp[1000][1000]; int max(int a,int b) { if(a>=b)retur...
P1894
奶牛位置 题解:
WRW
回复 0
|
赞 0
|
浏览 121
三叉树思想 #include<stdio.h> #include<malloc.h> #include<queue> #define MAX 100000 using namespace std; typede...
P1545
Aconly时间戳 题解:c++
damowanghwj
回复 0
|
赞 0
|
浏览 120
#include<bits/stdc++.h> using namespace std; int mday[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31}; int main(){ int n; while(...
P1501
括号匹配 题解:
easymoney
回复 0
|
赞 0
|
浏览 228
#include <stdio.h> #include <iostream> #include <algorithm> #include <stack> #include <string.h> using namespa...
P1548
设计密码 题解:
damowanghwj
回复 0
|
赞 0
|
浏览 120
#include<bits/stdc++.h> using namespace std; char ch[7] = {'~','!','@','#','%','^','$...
P1015
单链表 题解:顺便回忆一下头插法
1576684866
回复 0
|
赞 0
|
浏览 284
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; #include <string.h> #include <algorithm> #include <...
P1180
最简真分数 题解:
Śś
回复 0
|
赞 0
|
浏览 189
#include<iostream> #include<algorithm> using namespace std; int A[600+1]; int gcd(int a,int b) { if(a==0)r...
P1905
简洁
yanmy
回复 0
|
赞 0
|
浏览 117
#include <string> #include <sstream> #include <iostream> #include <algorithm> #include <vector> using namespac...
P1898
set sort 简短
yanmy
回复 0
|
赞 0
|
浏览 118
#include <iostream> #include <algorithm> #include <set> #include <vector> using namespace std; int main() { in...
P1642
字符串区间翻转 题解:ac80的同学应该是没有设置多组输入,这题也没说多组输入啊
damowanghwj
回复 0
|
赞 0
|
浏览 237
#include<bits/stdc++.h> using namespace std; const int N = 1e7+5; int arr[N]; int dp[N]; //char s[N]; int main() { int n...
P1172
最大序列和 题解:全改为long long
xjnotywlq
回复 0
|
赞 0
|
浏览 292
#include <stdio.h> #include <stdlib.h> long long n; long long a[100000]; long long dp[100000]={0}; long long max(long long a ,lo...
P1082
Hanoi塔问题 题解:
xjnotywlq
回复 2
|
赞 0
|
浏览 324
#include <stdio.h> #include <stdlib.h> int n; int count; void move(char a,char c){ count++; printf("%c-->%c ",a,...
P3666
单词翻转 题解:
望雨天
回复 0
|
赞 0
|
浏览 261
#include<iostream> #include<string> #include<vector> using namespace std; int main(){ char buf[10000]; &nbs...
P2014
找出众数 题解:
望雨天
回复 0
|
赞 0
|
浏览 202
#include<iostream> #include<map> using namespace std; int main(){ map<int,int>mp; //用mp存储输入元素以及其出现的次数 &n...
P1838
南京理工-括号匹配 题解:为什么不通过呢
A001
回复 2
|
赞 0
|
浏览 167
#include<iostream> #include<string.h> #include<map> #include<stack> using namespace std; int main(){ &...
P2011
字符串替换 题解:
望雨天
回复 0
|
赞 0
|
浏览 231
#include<iostream> #include<string> using namespace std; int main(){ string s; string to = "bai...
P1413
N阶楼梯上楼问题 题解:
huanghu
回复 0
|
赞 0
|
浏览 120
#include<stdio.h> #include<iostream> #include<vector> #include<string.h> #include<string> #include<algorith...
P1032
变位词 题解:C++ sort排序 去重 用map匹配出现次数
huanghu
回复 0
|
赞 0
|
浏览 163
#include<stdio.h> #include<iostream> #include<vector> #include<string.h> #include<string> #include<algorith...
P1175
Runtime Error 求大佬帮看
15240928957
回复 1
|
赞 0
|
浏览 193
#include <iostream> #include <stdlib.h> #include <map> using namespace std; struct node { int a, b; };...
P1400
特殊排序 题解:
fzh
回复 0
|
赞 0
|
浏览 201
#include<bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) &nb...
P1312
畅通工程 题解:仿Prim算法
fzh
回复 0
|
赞 0
|
浏览 185
#include<bits/stdc++.h> using namespace std; typedef struct Tri { int i; int j; &nbs...
P1375
素数 题解:
Kohi
回复 0
|
赞 0
|
浏览 179
#include <bits/stdc++.h> using namespace std; const int maxn = 1e4 + 1; int prime[maxn]; int ans[maxn]; void getPrime(){ ...
P1411
二叉排序树2 题解:坑点 不考虑等于的情况 等于的时候不插入
jenosa
回复 0
|
赞 0
|
浏览 161
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<int> v; typedef struct node{ ...
P1019
字母频率 题解:
1576684866
回复 0
|
赞 0
|
浏览 256
#define _CRT_SECURE_NO_WARNINGS #include <cstdio> using namespace std; #include <string.h> #include <algorithm> #include <...
P1156
质因数个数 题解:
easymoney
回复 0
|
赞 0
|
浏览 212
#include <stdio.h> #include <cstring> #include <iostream> using namespace std; const int maxn = 1000000 + 5; int prime[maxn]...
P1034
水仙花数 题解:
lingdongyang
回复 0
|
赞 0
|
浏览 218
#include<stdio.h> int main() { int m, n; while (scanf("%d %d", &m, &n) != EOF) { if (m == 0 && n == 0) { break;...
P1172
最大序列和 题解:
122793160
回复 0
|
赞 0
|
浏览 227
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ ...
P1035
简单背包问题,采用贪心枚举法,欢迎指正
Hegel
回复 1
|
赞 1
|
浏览 1.7k
#include <iostream> using namespace std; int main() { int sum, n; while (cin >> sum >> n) { int* a = new int[n]; fo...
P4933
括号匹配的问题 题解:
Demifiend2917
回复 0
|
赞 0
|
浏览 330
思路:括号匹配→栈 利用栈的先入后出,当访问到左括号`(`和`[`时,就入栈。当访问到右括号时,取栈顶元素,判断栈顶元素是否与左括号匹配,如果匹配,则继续进行字符的判断。 注意: ① 本解法仅阐述原理,有更优解法(如C++自带栈) ② 在访问右...
P2021
整数去重 题解:
Demifiend2917
回复 0
|
赞 0
|
浏览 241
思路1:建立两个数组,一个用于接收输入的待去重的数据;另一个用于计数 优点:一般人最先想到的方法;缺点:浪费空间。 思路2:只用一个数组计数,一边输入数据一边进行计数并判断是否要输出。 注意点: ① 由于输入的数在10~100范围内,直接创建一个长度...
P1014
加密算法 题解:C语言题解。一开始用的scanf,就发现错了,哈哈哈
渐鸿于陆
回复 0
|
赞 0
|
浏览 314
#include<string.h> #include<stdio.h> int main(void){ char s[105]; gets(s); &nbs...
P1474
大整数加法 题解:C语言,用字符数组存储大数
渐鸿于陆
回复 0
|
赞 0
|
浏览 221
#include<stdio.h> #include<string.h> char a[1005]; char b[1005]; char c[1005]; int _max(int a,int b){ re...
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇