自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 UVa 11520 - Fill the Square

UVA - 11520思路:每个单元与其周围单元比较确定最小字母#include #include #include #include #include #include using namespace std;const int MAXN = 10 + 5;char sq[MAXN][MAXN];char fill(int row, int col

2016-05-23 09:41:26 169

原创 UVa 789 - Indexing

UVA - 789思路:读取每行并处理每个单词(map自动按key排序)#include #include #include #include #include #include #include #include using namespace std;int main(void) { char key; int cln = 0; string

2016-05-22 23:37:25 192

原创 UVa 12290 - Counting Game

UVA - 12290#include #include #include #include #include #include #include using namespace std;bool is7(int n) { stringstream ss; ss << n; string s = ss.str(); if (s.find("7") == s.

2016-05-14 23:07:22 244

原创 UVa 100 - The 3n + 1 problem

100 - The 3n + 1 problem思路:算各个数的值,记录最大值#include #include #include #include #include #include #include using namespace std;int cyc(int n) { int cnt = 1; while (n != 1) { if (n

2016-04-30 20:45:21 162

原创 UVa 151 - Power Crisis

151 - Power Crisis思路:用queue处理关闭电力,注意N=13。#include #include using namespace std;int main(void) { int n; queue s; while (cin >> n && n != 0) { if (n == 13) { cout << "1" << endl

2016-04-27 23:59:30 346

原创 UVa 156 - Ananagrams

156 - Ananagrams思路:例题5-4#include #include #include #include #include #include #include #include using namespace std;map cnt;vector words;string repr(const string& s) { string

2016-04-25 23:37:57 153

原创 UVa 10815 - Andy's First Dictionary

10815 - Andy's First Dictionary思路:例题5-3#include #include #include #include #include #include using namespace std;set dict;int main(void) { string s, buf; while (cin >> s) {

2016-04-25 19:17:15 138

原创 UVa 101 - The Blocks Problem

101 - The Blocks Problem思路:见题解#include #include #include #include #include using namespace std;const int maxn = 30;int n;vectorpile[maxn];void find_block(int a, int& p, int& h)

2016-04-25 18:27:22 149

原创 UVa 673 - Parentheses Balance

673 - Parentheses Balance思路:用stack从左到右处理字符串,同种括号出栈异种入栈#include #include #include #include #include #include #include #include #include #include #include #include using names

2016-04-23 01:27:12 201

原创 *UVa 12504 - Updating a Dictionary

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=836&problem=3948&mosmsg=Submission+received+with+ID+17177113http://blog.csdn.net/zyq522376829/a

2016-04-10 15:23:42 190

转载 HDU 4707 Pet

http://blog.csdn.net/u014634338/article/details/42458007#include#include #include using namespace std;const int N=100010;int n,d,cnt;vectorv[N];void dfs(int j,int d){ if(d<0)

2016-04-04 19:23:17 165

原创 UVa 10391 - Compound Words

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=836&problem=1332&mosmsg=Submission+received+with+ID+17141001思路:用set储存,之后每个词分成两部分寻找是否有这两个单词(hash)。

2016-04-04 02:21:48 145

原创 UVa 1595 - Symmetry

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=836&problem=4470&mosmsg=Submission+received+with+ID+17140146思路:set记录所有点坐标,输入完成后计算对称轴x,判断每个点是否都存在对

2016-04-03 23:10:30 143

原创 UVa 10763 - Foreign Exchange

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=836&page=show_problem&problem=1704思路:渣算法,开两个数组一个记出发地一个记目的地,地点编号化为数组中位置然后该位置+1。最后只要两数组相同位置的整数都相等就说明人数正好。#inclu

2016-04-01 00:35:16 160

原创 UVa 10935 - Throwing cards away I

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=836&page=show_problem&problem=1876思路:按照要求更改,打印数组即可,注意n=1依旧需要"Discarded cards:"。#include #include #include

2016-03-31 22:27:37 180

原创 UVa 10474 - Where is the Marble?

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=835&page=show_problem&problem=1415关于lower_bound():http://blog.csdn.net/niushuai666/article/details/6734403#

2016-03-31 13:01:16 147

原创 UVa 12100 - Printer Queue

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=836&page=show_problem&problem=3252思路:简单题,先判断后面有没有优先级大的,再判断m是否为0。注意打印才加时间,交换位置不加时间。#include ]#include #include

2016-03-29 16:05:10 147

转载 HDU 2932 Extraordinarily Tired Students

http://blog.csdn.net/u012860063/article/details/39971559

2016-03-14 16:46:09 171

原创 第一篇博客

首次写博客,之后也不知道能写多少,想以此记录自己学习编程的过程。目前学习了Python、C、Java的基础语法,仅是初识阶段,希望保持热情,不断学习提升,今后取得技术进步,回过头再看这篇博客也能有不同的感受。

2016-02-21 13:12:08 130

空空如也

空空如也

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

TA关注的人

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