自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 UVa12100, Printer Queue

记录一下每个priority中所占的人数。这样可以在遍历到第一个最大priority的文件时停止。 #include <iostream> #include <cmath> #include <ctime> #include <climits> #include <iomanip> #include <cstring> #include <sstream> #include <algorithm> #incl

2020-05-14 21:06:40 118

原创 UVa1595, Symmetry

读入数据时顺便计算最左和最右的边界值,在读入完成时得到对称轴,然后遍历map即可。 #include <iostream> #include <algorithm> #include <vector> #include <map> #include <set> using namespace std; struct Point { double x, y; Point(double x = 0.0, double y = 0.

2020-05-14 19:12:45 156

原创 UVa 10391, Compound Words

虽然说n的范围很大,不得遍历,但还是尝试交了个遍历上去,果不其然的TLE了。 题中所给的“输入已按字典序从小到大排列”条件,其实是在暗示你可以按照输入的单词遍历(而非按照其组合遍历)。仅需要加一个判重map即可。 #include <iostream> #include <cmath> #include <ctime> #include <climits> #include <iomanip> #include <cstring>

2020-05-13 21:04:04 127

原创 UVa1592, Database

思路: for each (c1, c2) pair from columns { reset 'saved pairs' for each row { get current pair (data in (c1, r) and data in (c2, r)) if (current pair doesn't exist in 'saved pairs') save current pair with its row number.

2020-05-12 20:42:14 154

原创 UVa 400, Unix ls

添加了以下判定语句,来判断是否是当前行的最右一列。 index + rows >= n ? M : M + 2 #include <iostream> #include <cmath> #include <ctime> #include <climits> #include <iomanip> #include <cstring> #include <sstream> #include <algorith

2020-05-12 18:57:18 116

原创 UVa12108

大致思路:如果当前状态和记录有冲突,return -1。 #include <iostream> #include <cmath> #include <ctime> #include <climits> #include <iomanip> #include <cstring> #include <sstream&g...

2020-05-05 11:19:32 192

空空如也

空空如也

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

TA关注的人

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