首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
Candour
天天原神启动不训练,考研还想上岸?
关注
发消息
文章
0
题解
117
发帖
0
笔记
12
Ta的粉丝
69
关注数
2
粉丝数
69
获赞数
866
阅读数
120020
最大序列和(75%的巨坑!!!(贪心 ))题解:
题目中序列的值应该也是用long long存(用int存只能过75%),题目只给了序列和的数据范围,太折磨人了,害我WA好几次 #include<bits/stdc++.h> using namespace std; typedef long long L...
P1172
2024年5月17日 00:08
回复 1
|
赞 20
|
浏览 1.3k
字符个数(C++) 题解:
#include<bits/stdc++.h> using namespace std; string str; int a, b, c, d; int main() { getline(cin, str); for(int i = 0; i ...
P1042
2024年5月21日 23:48
回复 0
|
赞 8
|
浏览 736
分数求和 题解:
#include<bits/stdc++.h> using namespace std; int n; int main() { cin >> n; double ans = 0; int zi = 2, mu = 1; fo...
P1047
2024年5月20日 23:40
回复 0
|
赞 2
|
浏览 682
abc(C++) 题解:
#include<bits/stdc++.h> using namespace std; int main() { for(char a = '0'; a <= '9'; a ++) for(char b = '0'; b <= '9'; b +...
P1165
2024年5月20日 00:23
回复 0
|
赞 2
|
浏览 725
统计字符(C++) 题解:
#include<bits/stdc++.h> using namespace std; string a, b; int main() { while(getline(cin, a)) { if(a == "#") return 0; ...
P1320
2024年5月20日 00:07
回复 0
|
赞 8
|
浏览 945
简单背包问题(一维01背包, 题目中体积和价值是一样的) 题解:
注意是多组测试输入 (没注意就WA一次) #include<bits/stdc++.h> using namespace std; const int N = 1010; int dp[N], w[N]; int n, m; int main() { ...
P1035
2024年5月19日 00:17
回复 0
|
赞 39
|
浏览 1.2k
旋转方阵(模拟) 题解:
#include<bits/stdc++.h> using namespace std; const int N = 110; int n, cnt = 1; int res[N][N]; int main() { cin >> n; ...
P1216
2024年5月18日 23:37
回复 0
|
赞 37
|
浏览 1.5k
日期类(模拟) 题解:
#include<bits/stdc++.h> using namespace std; int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int n; int y, m, d; ...
P1437
2024年5月16日 23:26
回复 0
|
赞 7
|
浏览 1.1k
最大公约数1(空间复杂度O(1)) 题解:
没开数组,优化了内存,时间复杂度O(n) #include<bits/stdc++.h> using namespace std; int n; int main() { int a = INT_MAX, b = -1; scan...
P1426
2024年5月16日 00:40
回复 0
|
赞 12
|
浏览 1.5k
二叉树的建立和遍历(模拟) 题解:
#include<bits/stdc++.h> using namespace std; int cnt; string str; typedef struct Tree{ char v; Tree *l, *r; }Tree; Tree *b...
P1109
2024年5月16日 00:21
回复 0
|
赞 6
|
浏览 1.0k
细菌的繁殖(优雅前缀和) 题解:
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1010; int n; LL ans; LL s[N]; //前缀和 void s_init...
P1033
2024年5月15日 00:58
回复 0
|
赞 7
|
浏览 1.7k
平方和与倒数和(n项和、n项平方和公式秒了) 题解:
n项倒数和公式: 欧拉常数是无理数,该公式只能用于估算,不可取; n项和: 等差数列:n *(a1 + an) / 2 n项平方和: #include<bits/stdc++.h> using namespac...
P1045
2024年5月15日 00:43
回复 0
|
赞 9
|
浏览 1.0k
平均值(C++ cout直接输出就行,不用特判,最短代码) 题解:
C++中std::cout输出浮点数默认精度是6位有效数字 #include<bits/stdc++.h> using namespace std; int a, b; int main() { double res; scan...
P1132
2024年5月13日 23:40
回复 0
|
赞 7
|
浏览 1.1k
偷菜时间表(模拟) 题解:
#include<bits/stdc++.h> using namespace std; int n; int m, h; void gets_res() { h = (h + 13) % 24; h = h + (m + 15) / 60; //加...
P1053
2024年5月13日 23:31
回复 0
|
赞 11
|
浏览 1.0k
素数判定 (试除法 O(n*sqrt(n))题解:
1000的数据量可以过 #include <bits/stdc++.h> using namespace std; int a, b; bool cheak(int x) { for(int i = 2; i <= x / i; i ...
P1102
2024年5月10日 23:48
回复 0
|
赞 2
|
浏览 1.5k
迷宫(C++11 bfs宽搜 附详细注释) 题解:
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> PII; const int N = 110; int n, m; char g[N][N]; //存图 in...
P1563
2024年5月10日 23:39
回复 0
|
赞 18
|
浏览 1.4k
大整数加法(大数问题py直接秒了) 题解:
while True: try: a, b = map(int, input().split()) print(a + b) except: break
P1474
2024年5月10日 00:03
回复 0
|
赞 4
|
浏览 971
质因数个数(数论)题解:
#include<bits/stdc++.h> using namespace std; int n; int divide(int n) { int cnt = 0; for(int i = 2; i <= n / i; i ++) ...
P1156
2024年5月8日 23:55
回复 0
|
赞 10
|
浏览 970
整数奇偶排序(多组测试输入) 题解:
#include<bits/stdc++.h> using namespace std; const int N = 15; int num[N]; int og[N], os[N]; int cnt, cnt1, cnt2; int main() { ...
P1248
2024年5月8日 23:43
回复 0
|
赞 2
|
浏览 802
阶乘和(优雅的递归) 题解:
注意数据范围,递归函数里的x也会爆int #include <bits/stdc++.h> using namespace std; typedef long long LL; int n; LL ans; LL dfs(LL x) { ...
P1044
2024年5月8日 00:31
回复 0
|
赞 2
|
浏览 744
1
2
3
4
5
6
本科学校:星穹铁道职业技术学院
目标学校:贵州大学
点此申请N诺身份认证
获得 noobdream 认证,享受多重认证福利!