主站
DreamJudge
院校信息
专业题库
模拟考试
机试真题
专业课程
讨论区
兑换中心
登录
注册
上岸
搜索
推 荐
择校分析
笔经面经
学习交流
我要提问
站内公告
调剂专题
精彩爆料
解题报告
P1410
打印日期(用前缀和写了一下 附注释) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 31
#include<bits/stdc++.h> using namespace std; int y, d; int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int s[13]; ...
P1476
查找学生信息2(结构体数组) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 18
#include <bits/stdc++.h> using namespace std; const int N = 1010; int n, m; struct student{ string id; string name; string g...
P1472
2048游戏 题解:简洁实现
qianqiangotoTHU
回复 0
|
赞 1
|
浏览 23
过了之后本来想看看有没有好玩的解法的,但是看到目前的题解都比较臃肿,要用100行以上代码实现,就打算分享一下自己的50+行代码的思路。 一、简洁实现四个方向 代码长主要是因为要实现四个方向的遍历,如果写四遍两层循环就巨麻烦 观察可以发现,只要对循环变量i j做一定的变换,就能...
P1221
旋转矩阵 题解:简单粗暴的解法
Jackeens
VIP
回复 0
|
赞 1
|
浏览 11
两个矩阵交替使用,避免每次操作使用修改后的元素带来错误。 flag==1,当前使用ans1矩阵,flag==2,当前使用ans2矩阵。 三个操作都很简单,找规律就行。 #include<cstdio> using namespace std; int ans1[1...
P1180
最简真分数(最大公约数) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 24
最大公约数是1,说明两个数互质,也就是最简真分数 #include<bits/stdc++.h> using namespace std; const int N = 1010; int n; int a[N]; int main() { ...
P1392
杨辉三角形(模拟 - 不输出第一行) - 西北工业大学 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 26
#include <bits/stdc++.h> using namespace std; const int N = 30; int n; int res[N][N]; void get_triangle() { for(int i = 1; i &l...
P1038
成绩的等级(选择分支结构) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 30
#include<bits/stdc++.h> using namespace std; int s; int main() { cin >> s; if(s >= 90) puts("A"); els...
P1377
旋转矩阵(模拟 - 注意多组测试输入--第一次交没注意过了80%) - 北航 题
我能走到对岸吗
回复 0
|
赞 1
|
浏览 38
#include<bits/stdc++.h> using namespace std; const int N = 20; int a[20][20], b[20][20]; int n; int cheak() { bool t = true;...
P1005
博学楼的阶梯(模拟 思路清晰易懂 附注释) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 66
优化了内存,没有开数组 #include <bits/stdc++.h> using namespace std; int T; int main() { cin >> T; while(T --) { in...
P1290
日期差值(格式化输入) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 38
#include<bits/stdc++.h> using namespace std; const int months[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; bool ch...
P1500
求S(n) (同余定理)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 73
( a * b) % m = ((a % m) * (b % m)) % m #include <bits/stdc++.h> using namespace std; int n; int main() { while(cin >>...
P1217
国名排序(C++) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 39
#include <bits/stdc++.h> using namespace std; vector<string> res; int n; int main() { string s; while(cin >>...
P1254
字符串排序 (C++)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 49
#include<bits/stdc++.h> using namespace std; int main() { string str; while(cin >> str) { sort(str.begin(),...
P1394
统计单词(C++) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 63
#include<bits/stdc++.h> using namespace std; string str; int main() { while(getline(cin, str)) { int cnt = 0; ...
P1159
成绩排序2.0 (C++)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 50
#include<bits/stdc++.h> using namespace std; typedef pair<int, int> PII; const int N = 110; PII s[N]; int n; bool cmp(PII a...
P1041
最大公约数和最小公倍数 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 66
#include<bits/stdc++.h> using namespace std; int n, m; int main() { cin >> n >> m; cout << __gcd(...
P1417
八进制 (格式化输出)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 49
#include <bits/stdc++.h> using namespace std; int n; int main() { while(cin >> n) { printf("%o\n", n); } return 0;...
P1292
字母统计 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 82
#include <bits/stdc++.h> using namespace std; string str; int cnt[27]; int main() { while(cin >> str) { memset(cnt, ...
P1151
成绩排序 题解:大佬帮我看看为什么AC50%,普通冒泡排序,考虑了稳定性的
15984861226
回复 1
|
赞 0
|
浏览 66
#include <iostream> using namespace std; class grade{ public: char name[100]; float gra; &nbs...
P1658
上楼梯 题解:dp,注意 2+1与1+2 是两种方式
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 43
#include<bits/stdc++.h> using namespace std; int n; int dp[10000005]; int main(){ dp[1]=1,dp[2]=2,dp[3]=4;  ...
P1024
二元组整数 题解:使用DFS,输出前2位,应该也可以实现
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 44
#include<bits/stdc++.h> using namespace std; int main(){ return 0; }
P1590
快速排序 题解:yxc快排模板
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 46
void quick_sort(int q[],int l,int r){ if(l>=r) return; int i=l-1,j=r+1,x=q[l+r>>1]; whi...
P1388
查找1 (C++ 11)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 58
#include<bits/stdc++.h> using namespace std; unordered_map<int, bool> st; int n, m; int main() { while(cin >> n) ...
P1051
日期计算(简单模拟) 题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 80
#include <bits/stdc++.h> using namespace std; int y, m, d; int month[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; boo...
P1714
素数求和 题解:标记法
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 36
#include<bits/stdc++.h> using namespace std; int main(){ int sum=0,flag[100]={0}; for(int i=2;i<=100;i++...
P1355
素数判定 - 哈尔滨工业大学 题解:,标记法,注意1不是素数
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 37
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n){ &n...
P1375
素数 (试除法 O(m * n * sqrt(n)))题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 43
100 * 10000 * 100 = 1e8 勉强能过, 如果输入的数据大于100组就过不了了,就得用线性筛(C/C++ 1s能处理1e7 - 1e8的规模) #include<bits/stdc++.h> using namespace std; int...
P1473
字符棱形 (找规律)题解:
我能走到对岸吗
回复 0
|
赞 1
|
浏览 64
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; int t = n, cnt = 1; //打印n行,上半 while(t...
P1374
找最小数 题解:结构体+sort()
拉萨小队长
VIP
回复 0
|
赞 0
|
浏览 38
#include<bits/stdc++.h> using namespace std; struct node{ int x,y; }p[100]; bool compare(node a,node b){  ...
P1240
首字母大写 题解:
等等
回复 0
|
赞 0
|
浏览 40
#include<bits/stdc++.h> using namespace std; int main(){ string s; while(getline(cin,s)){ &nbs...
1
2
3
...
127
我要提问
近期热门
1
N诺成就值出炉,帮你一眼识别大神
2
机试如何才能快速提高?
3
[置顶]计算机考研择校分析【25考研必读】
4
广度优先搜索计算每个人移动到每个位置需要去掉障碍物的最少数目,最后求和的最小值
5
1377旋转矩阵
6
ip地址(C)
7
简单易懂
8
C++递归解法,有注释
9
1017 幂次方 快速幂模板
10
计算机考研复试笔记——操作系统篇