自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Let_life_stop的博客

任凭生命去阻拦!

  • 博客(22)
  • 收藏
  • 关注

原创 D - Fliptile

题目: Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 15; 1 ...

2018-05-31 21:47:50 340

原创 B - Dungeon Master

You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one unit north, south...

2018-05-29 21:22:08 241

原创 棋盘问题 poj

在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n...

2018-05-28 20:59:46 571

原创 B. Switches and Lamps

 B. Switches and Lampstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n switches and m lamps. The i-th switch tu...

2018-05-26 16:23:23 539 1

原创 抓住那只猫

题目链接:https://vjudge.net/contest/65959#problem/C   注意点:#include<iostream>#include<queue>#include<cstring>#include<algorithm>using namespace std;int main(){    int n,m...

2018-05-25 21:07:59 1211

原创 C. Cut 'em all!

题目链接:http://codeforces.com/contest/982/problem/C题目大意:就是先给出n个节点,然后再给出n条边,再判断最少去掉多少条边能使剩下的相连的是偶数。具体思路:首先建立好对应关系,然后再进行dfs。判断每一个父亲节点的子节点的个数是不是偶数,如果是偶数就可以砍掉,如果不是偶数,则不可以砍掉。代码如下:#include<bits/stdc...

2018-05-25 19:41:21 331

原创 B. Bus of Characters

B. Bus of Characterstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the Bus of Characters there are nn rows of seat, each hav...

2018-05-21 23:42:29 362

转载 Row

A. Rowtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given a row with n chairs. We call a seating of people "maximal" if the two following ...

2018-05-21 20:20:59 420

原创 优先队列的初级使用

给定五个数,分别按照最小值和最大值进行排序。#include<bits/stdc++.h>using namespace std;#define INF 0x3f3f3f3fint main(){int n;cin>>n;priority_queue<int ,vector<int >,greater<int > >wakaka;//gr...

2018-05-19 15:14:46 151

原创 BFS摸板题

题目链接:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/2141.html代码如下:#include<bits/stdc++.h>using namespace std;int a[101][101];int visited[101];int b[101];int ...

2018-05-18 23:28:23 156

原创 DFS-走迷宫

题目链接:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/2449.html代码展示:#include<bits/stdc++.h>using namespace std;int a[10][10],visited[10][10];int step;int n,m;v...

2018-05-18 21:40:25 342

原创 lower_bound函数的初级使用

lower_bound函数的本质是二分查找,这个函数的作用是在给定的数组中,如果要寻找某一个数,这个函数的作用就是能找到数组中大于等于该值的下标。代码展示:#include<bits/stdc++.h>using namespace std;int main(){    int a[100];    int n;    cin>>n;    for(int i=1; i&l...

2018-05-13 19:55:09 658

转载 全排列的变换(冒泡)

听取了别的思路,不是自己做出来的。。。。全排列的变换Time Limit: 1000 msMemory Limit: 65536 KiBProblem Description小鑫今天从玄黄那里拿到了一个长度为n的全排列,可是小鑫不喜欢这个全排列,于是小鑫想要把这个全排列变成他希望的样子。但是全排列不是随便就能变换的,全排列每次变换只能交换相邻的两个数位。例如:123可以通过一步变换变成132,但是...

2018-05-13 12:13:15 231

原创 2018 5 12 B - Mahmoud and Ehab and the message

题目链接:https://cn.vjudge.net/contest/228833#problem/B题目的意思就是:首先给出一个字符串,下一行再给出每一个单词的权值,接下来几行是用来说明哪几个单词的权值可以相互找最小,最后一行给出一个字符串,然后判断最后一句话的所有单词的权值。思路:使用strl中的map操作,map的第一个位置用来存每一个字符串,第二个位置用来存每一个字符串的权值,这是...

2018-05-12 23:39:40 211

原创 最少拦截系统

题目链接:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/2075.html具体思路:首先,没有必要全部输入完之后再去重新判断,完全可以一边输入一遍判断。每输入一个数,就在已经存在的导弹中寻找一个能够大于或者等于这个高度的,如果有的话,再从中选择这个满足高度中最小的那一个,如果没有,就再加一个...

2018-05-11 19:45:11 482

原创 2018.5.10训练题

Polycarp likes to play with numbers. He takes some integer number xx, writes it down on the board, and then performs with it n−1n−1 operations of the two kinds:divide the number xx by 33 (xx must be d...

2018-05-10 23:35:56 258

原创 12-6

 #ifndef SHAPE_H#define SHAPE_H#include <iostream>using namespace std;class Shape{public:    virtual double Area() const    {        return 0.0;    }    virtual void PrintShapeName() const = 0; ...

2018-05-09 13:10:17 170

原创 5.8上机

#include<iostream>using namespace std;class Complex{double a;double b;public: Complex(double w=0,double d=0):a(w),b(d){} double GetA(){return a;} double GetB(){return b;} Complex operator + (Com...

2018-05-08 14:53:16 148

原创 课本例题真的迷,可能是让我们在找bug的时候锻炼自己。。

说一下传值调用的定义:传值调用是指在调用参数的时候,不是对原函数进行操作,而是创建参数的拷贝并对其进行操作,这种调用有利于保护数据。(百度上找的,其实我也不太懂)我觉得传值调用就一个作用,在对实参进行函数的加工时,改变形参所对应实参的值,,,没了。。。接下来这个代码就很好的解释了这个定义。#include<bits/stdc++.h>using namespace std;void  ...

2018-05-06 20:17:36 261

原创 马兰过河卒问题

题目链接:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid/1265.html大体意思就是给你图的大小,给你一个棋子,一次只能往下走一步或者往右走一步,还有一些点是不能走的,然后让你输出从0.0这个点到达对角线上的点的路径数。具体思路:首先讲不能走的点单独标记出来,然后采用遍历的方法求出...

2018-05-04 20:30:57 1013

原创 strtok函数的一般用法

gets需要头文件,#include<stdio.h>. strtok函数对应的头文件是#include<cstring>strtok函数能够对字符串按照给定的字符进行切割,比如说这一段:hah haha hahaha如果按照空格进行切割的话切割后的结果应该是hah,haha,hahaha。这样的话就可以判断一个句子中有多少单词了。代码如下:#inclu...

2018-05-03 17:59:02 246

原创 余数定理处理大数问题

对于10 的1000次方这种大数,用普通的int或着long long int肯定存不了,这个时候就可以考虑用字符串来存数,这样的话就算是有1000位的数,开一个1000的字符串就够了。如果 要对字符串里的数进行取余,可以用余数定理。题目链接:http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Index/problemdetail/pid...

2018-05-03 17:46:01 827

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除