首先说清楚:
code-server是个完全不成熟的技术,因为VScode online目前就不成熟,而且也有浏览器的限制。所以这个技术完全就不是很能运用到日常的生产中。
但是!如果你像我一样,渴求在iPad上打Codeforces,或者是有个垃圾Chrome本,或者是只能带起来Chrome的设备。这是个应急的方案。
[……]
首先说清楚:
code-server是个完全不成熟的技术,因为VScode online目前就不成熟,而且也有浏览器的限制。所以这个技术完全就不是很能运用到日常的生产中。
但是!如果你像我一样,渴求在iPad上打Codeforces,或者是有个垃圾Chrome本,或者是只能带起来Chrome的设备。这是个应急的方案。
[……]
题目就是问将一个匹配的括号序列的两个交换,新括号序列匹不匹配。每次查询不影响下次查询,所以这就是离线查询,区间RMQ问题。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
#include<cstdio>//uncle-lu #include<cmath> #include<algorithm> template<class T> void read(T &x) { x=0;bool f=false;char ch=getchar(); while(ch<'0'||ch>'9') { f|=(ch=='-'); ch=getchar(); } while(ch>='0'&&ch<='9'){ x = (x<<1) + (x<<3) + (ch^48); ch = getchar(); } x = f ? -x : x; return ; } void ST_prework(void); int Find_max(int, int); int n,m; int line[100010]; int F[100010][20]; void ST_prework() { for(int i=1;i<=n;++i) F[i][0] = line[i]; int t = log(n) / log(2); for(int j=1;j <= t;++j) for(int i=1;i<=n - ( 1<<j ) + 1;++i) F[i][j] = std::max(F[i][j-1], F[i + ( 1<<(j-1)) ][j-1]); return ; } int Find_max(int x, int y) { int t = log(y-x+1) / log(2); return std::max(F[x][t],F[y - (1 << t ) + 1][t]); } int main() { int x,y; read(n);read(m); for(int i=1;i<=n;++i) read(line[i]); ST_prework(); for(int i=1;i<=m;++i) { read(x);read(y); printf("%d\n",Find_max(x,y)); } return 0; } |
luoguP3865模板
预处理的时候就是将ij这个区间分成两块,然后合并
查询的时候也是这个思想,分成两块,然后合并。[……]
这是一个留言板项目,仅仅刚好展示了flask整体框架。虽然我是一个字符不落的抄了一边,各部分均有学习到新知识,罗列一下。
需要对项目有一个整体的规划,先列需求表,写需求说明书。之后再说设计与技术上的实现。
前端方面,先用原型软件进行绘图。可以将每个接口都想详细一点,最好都列出来。[……]