题目集链接:https://www.patest.cn/contests/gplt
2018年的天梯赛,鄙人很不幸成为了我们队的拖油瓶(手动笑哭
2018年的真题(19~21题)以后会更新……吧……
天梯赛的一点个人经(jiao)验(xun):
该比赛没有罚时,而且测试点分值的分布极其诡异(经常是第一个小数据就十多分),所以尽最大可能骗分!
今年L3的三道题,3-1是一道极其恶心的模拟(手动AStyle),我x他xx的xxx这xx是什么xx玩意儿……
3-2和3-3都可以直接写暴力骗分。3-2我写了个O(n^4)的模拟骗了22分,3-3本可以骗些分的,结果我沙茶了没写……
前面的部分1-1和2-4都挺坑的。2-4要考虑-0的情形,恶心程度瞬间提升了几个档次(
个人感觉这套题的特点:思路不算很难,但是有些细节繁杂得要死。尤其是某些图论题(感觉基本上都是最短路)的输入和输出,不多说了自行体会。
考察的知识点不算多,不过比较考验实现能力,所以拿来练练手还是不错的。
贴一下本文部分代码用的板子。像#define pb(v, x) v.push_back(x)这样激进的缩写法我是完全习惯不了(手动笑哭)
1 #include <cctype> 2 #include <cmath> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <cstring> 6 7 #include <forward_list> 8 #include <list> 9 #include <map> 10 #include <queue> 11 #include <set> 12 #include <stack> 13 #include <unordered_map> 14 #include <unordered_set> 15 #include <vector> 16 17 #include <algorithm> 18 #include <functional> 19 #include <iostream> 20 #include <iterator> 21 #include <numeric> 22 #include <stdexcept> 23 #include <string> 24 #include <tuple> 25 #include <utility> 26 27 #define FILL(arr, ch) memset(arr, ch, sizeof(arr)) 28 29 using namespace std; 30 31 using LL = long long; 32 template <class Tp> 33 using MinHeap = priority_queue<Tp, vector<Tp>, greater<Tp>>; 34 template <class Tp> 35 using MaxHeap = priority_queue<Tp>; 36 37 template <class RAIter> 38 inline void sortGt(RAIter first, RAIter last) { sort(first, last, greater<decltype(*first)>() ); } 39 40 const double eps = 1e-8; 41 const int inf = 0x3f3f3f3f; 42 const long long inf64 = 0x3f3f3f3f3f3f3f3fLL; 43 44 inline bool isEq(double x, double y) { return fabs(x - y) <= eps; } 45 inline bool isLt(double x, double y) { return y - x > eps; } 46 inline bool isGt(double x, double y) { return x - y > eps; }