- 博客(23)
- 收藏
- 关注
转载 P1093 奖学金
P1093 奖学金 题目链接:https://www.luogu.org/problem/P1093 思路: 该题可以使用结构体加sort排序。 代码: #include <bits/stdc++.h> using namespace std; typedef struct pri { int z,y,h; }pri; pri c[500]; bool cmp...
2019-08-01 22:37:00
225
转载 P1068 分数线划定
P1068 分数线划定 题目链接:https://www.luogu.org/problem/P1068 思路: 该题可以使用结构体加sort排序。 代码: #include <bits/stdc++.h> using namespace std; typedef struct pri//结构体 { int k; int s; }pri; pri a[1...
2019-08-01 21:35:00
191
转载 P1781 宇宙总统
P1781 宇宙总统 题目链接:https://www.luogu.org/problem/P1781 思路: 因为票数可能会很大,可能会到100位数字,即10的100次方,所以将这个数字每一位都存入字符串。 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in....
2019-08-01 20:53:00
237
转载 P1059 明明的随机数
P1059 明明的随机数 题目链接:https://www.luogu.org/problem/P1059 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout);...
2019-08-01 20:38:00
147
转载 P1328 生活大爆炸版石头剪刀布
P1328 生活大爆炸版石头剪刀布 题目链接:https://www.luogu.org/problem/P1328 思路: 由题意可知,0—剪刀,1—石头,2—布;3—蜥蜴人,4—斯波克。 则 0<1,0>2,0>3,0<4; 1<2,1>3,1<4; 2<3,2>4; 3>4; 代码: #include <bits...
2019-08-01 20:32:00
166
转载 P1003 铺地毯
P1003 铺地毯 题目链接:https://www.luogu.org/problem/P1003 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-08-01 20:20:00
145
转载 1128: mxh道歉记
1128: mxh道歉记 题目链接:https://oj.chimuyuan.cn/problem/show/1128 代码: #include <bits/stdc++.h> using namespace std; char a[50][50]; int b[8][2]={{-1,1},{0,1},{1,1},{-1,0},{1,0},{-1,-1},{0,-1},{1...
2019-08-01 20:04:00
268
转载 今天,你惹对象生气了吗
今天,你惹对象生气了吗 题目链接:https://ac.nowcoder.com/acm/contest/298/B 思路: 先对可以采的花进行覆盖,再用dfs进行搜索。 代码: #include <bits/stdc++.h> using namespace std; char a[100][100]; int n,m,x,y; int b[4][2]={{0,1},{...
2019-08-01 19:37:00
197
转载 油田
油田 题目链接:https://vjudge.net/problem/ZOJ-1709 思路: 多组输入直到输入00为止,输出油田的个数;利用dfs进行搜索。 代码: #include <bits/stdc++.h> using namespace std; char a[105][105]; int b[8][2]={{-1,1},{0,1},{1,1},{-1,0}...
2019-08-01 19:23:00
238
转载 P1055 ISBN号码
P1055 ISBN号码 题目链接:https://www.luogu.org/problem/P1055 代码: #include <bits/stdc++.h> using namespace std; int main() { freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-07-27 21:01:00
173
转载 P1200 [USACO1.1]你的飞碟在这儿Your Ride Is He…
P1200 [USACO1.1]你的飞碟在这儿Your Ride Is He… 题目链接:https://www.luogu.org/problem/P1200 代码: #include <bits/stdc++.h> using namespace std; int main() { freopen("in.txt","r",stdin); //freop...
2019-07-27 20:16:00
171
转载 P1914 小书童——密码
P1914 小书童——密码 题目链接:https://www.luogu.org/problem/P1914 代码: #include <bits/stdc++.h> using namespace std; int main() { freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-07-27 19:53:00
139
转载 P1028 数的计算
P1028 数的计算 题目链接:https://www.luogu.org/problem/P1028 思路: 找规律。 1 :1 (1) 2: 2 (2,12) 3: 2 (3,13) 4: 4 (4,14,24,124) = 2+2 5: 4 (5,15,25,125) 6: 6 (6,16,26,36,126,136)= 4+2 7: 6 (7,17,27,37,127,137...
2019-07-27 18:19:00
168
转载 P1149 火柴棒等式
P1149 火柴棒等式 题目链接:https://www.luogu.org/problem/P1149 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-07-27 17:25:00
119
转载 P1478 陶陶摘苹果(升级版)
P1478 陶陶摘苹果(升级版) 题目链接:https://www.luogu.org/problem/P1478 思路: 这题要比想象的要简单,因为在相同气力下,陶陶无论是摘高的还是低的都不影响,所以这题只需要把气力从小到大排就好了。 代码: #include <bits/stdc++.h> using namespace std; int main() { ...
2019-07-27 16:18:00
118
转载 P1618 三连击(升级版)
P1618 三连击(升级版) 题目链接:https://www.luogu.org/problem/P1618 思路: 判断三个数的每一位加起来是否等于从1加到9,且每一位相乘是否等于从1乘到9; 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","...
2019-07-27 16:13:00
153
转载 P1579 哥德巴赫猜想(升级版)
P1579 哥德巴赫猜想(升级版) 题目链接:https://www.luogu.org/problem/P1579 代码: #include <bits/stdc++.h> using namespace std; int x,i; int y(int x){ //判断是否是素数; for(i=2;i<=sqrt(x);i++){ if(x...
2019-07-27 16:06:00
189
转载 P2089 烤鸡
P2089 烤鸡 题目链接:https://www.luogu.org/problem/P2089 思路: 很简单,就是不停for循环; 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out....
2019-07-27 15:53:00
149
转载 P1426 小鱼会有危险吗
P1426 小鱼会有危险吗 题目链接:https://www.luogu.org/problem/P1426 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout)...
2019-07-27 15:49:00
151
转载 P1014 Cantor表
P1014 Cantor表 题目链接:https://www.luogu.org/problem/P1014 思路: 找规律,按每一斜行来看,则: 第一行: 1/1; //总数:1; 第二行: 1/2 2/1; //总数:1+2=3; 第三行: 3/1 2/2 1/3; //总数:1+2+3=6; 第四行: 1/4 2/3 3/2 4/1; //总数:1+2+3+4=10; 第五行:...
2019-07-27 15:39:00
129
转载 P1307 数字反转
P1307 数字反转 题目链接:https://www.luogu.org/problem/P1307 代码 #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-07-26 21:23:00
157
转载 P1598 垂直柱状图
P1598 垂直柱状图 题目链接:https://www.luogu.org/problem/P1598 代码: #include <bits/stdc++.h> using namespace std; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); ...
2019-07-26 21:15:00
200
转载 P1217 [USACO1.5]回文质数 Prime Palindromes
P1217 [USACO1.5]回文质数 Prime Palindromes 题目链接:https://www.luogu.org/problem/P1217 以下是思路: 1.先找出1到100000000的所有回文数字; 2.再判断这些数里的质数; 3.所有偶数位(除11外)的回文数都不是质数; 4.所有能被2整除的数都不是质数; #include <bits/stdc++.h&...
2019-07-25 19:49:00
179
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅