- 博客(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 91
原创 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 126
原创 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 101
原创 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 125
原创 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 87
原创 UVa12108
大致思路:如果当前状态和记录有冲突,return -1。#include <iostream>#include <cmath>#include <ctime>#include <climits>#include <iomanip>#include <cstring>#include <sstream&g...
2020-05-05 11:19:32 153
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人