匆忙而简捷地办完了年度招新活动,实现了第一次JNUOJ线上赛。
搭建OJ时不能实现预期中的多服务器并行处理,但评测效率已满足需求
VJ始终无法使用,不知原BNUOJ开发者是否会继续维护
命题未免太强调难度了
A. 篱笆和人
#include#include #include #include #include #include #include #include #include
匆忙而简捷地办完了年度招新活动,实现了第一次JNUOJ线上赛。
搭建OJ时不能实现预期中的多服务器并行处理,但评测效率已满足需求
VJ始终无法使用,不知原BNUOJ开发者是否会继续维护
命题未免太强调难度了
#include#include #include #include #include #include #include #include #include
Ubuntu查看运行中的进程及其id、监听端口
sudo netstat -anp
查询进程id
pidof
安全终止某个进程
kill -15
后台运行某个进程
nohup&
内存空间不足的临时解决办法
How To Create A Swap File In Linux
linux下由于内存不足造成的 virtual memory exhausted: Cannot allocate memory, qt **.o文件 file not found
尝试转入这个github
推荐的代码编辑器。
宣传视频非常有趣。
在github
平台的依托下,Atom在主题风格、插件扩展上异常灵活。
甚至提供apm install atom-beautify
这种命令行安装扩展的方式。
为了帮助初学Java的同学,现给出查看jdk源代码的提示:
相关文件为$JAVA_HOME$/src.zip
/* * File: main.cpp * Author: semprathlon * * Created on April 26, 2016, 7:18 PM */ #include#include #include #include #include using namespace std; struct Rectangle{ int x1,y1,x2,y2; Rectangle(){} Rectangle(int _x1,int _y1,int _x2,int _y2):x1(_x1),x2(_x2),y1(_y1),y2(_y2){} }; vector rects; bool cmp(const int& a,const int& b){ if (abs(a-b)<1e-5) return 0; return a-b<0; } int unionPerimeterY(const vector & rects){ if (rects.empty()) return 0; typedef pair > Event; vector events; vector ys; for(int i=0;i y2) swap(y1,y2); sum[y1]+=delta; sum[y2]-=delta; int cnt=0,tmp=0; for(int j=0;j & rects){ if (rects.empty()) return 0; typedef pair > Event; vector events; vector xs; for(int i=0;i x2) swap(x1,x2); sum[x1]+=delta; sum[x2]-=delta; int cnt=0,tmp=0; for(int j=0;j >n){ if (!n) break; rects.clear(); for(int i=0;i >x1>>y1>>x2>>y2; rects.push_back(Rectangle(x1,y1,x2,y2)); } cout<
POJ 1151 / hdu 1828 矩形面积并 扫描线+线段树
/* * File: main.cpp * Author: semprathlon * * Created on April 9, 2016, 10:19 AM */ #include#include #include #include #include using namespace std; struct Rectangle{ double x1,y1,x2,y2; Rectangle(){} Rectangle(double _x1,double _y1,double _x2,double _y2):x1(_x1),x2(_x2),y1(_y1),y2(_y2){} }; vector rects; vector ys; struct SegTree{ SegTree *lchild,*rchild; int l,r,m; double s; int w; SegTree(){} SegTree(int _l,int _r):l(_l),r(_r){ m=(l+r)>>1;w=0;s=0; if (l 0) s=lchild->s+rchild->s; } void down(){ if (w>0){ lchild->w+=w; rchild->w+=w; if (lchild->w) lchild->s=ys[lchild->r+1]-ys[lchild->l]; if (rchild->w) rchild->s=ys[rchild->r+1]-ys[rchild->l]; s=w=0; } } void modify(int x,int y,int v){ if (l==r){ w+=v; if (w>0) s=ys[r+1]-ys[l]; else s=0; return; } if (x==l&&r==y){ w+=v; if (w>0){ s=ys[r+1]-ys[l]; return; } else s=0; } down(); if (x<=m) lchild->modify(x,min(m,y),v); if (y>m) rchild->modify(max(m+1,x),y,v); up(); } double query(int x,int y){ //cout<<"q "< 0?s:0; if (x==l&&r==y&&w>0){ return s; } down(); double res=0; if (x<=m) res+=lchild->query(x,min(m,y)); if (y>m) res+=rchild->query(max(m+1,x),y); up(); return res; } } *T; bool cmp(const double& a,const double& b){ if (abs(a-b)<1e-5) return 0; return a-b<0; } double unionArea(const vector & rects){ if (rects.empty()) return 0; typedef pair > Event; vector events; ys.clear(); for(int i=0;i cnt(ys.size()-1,0); for(int i=0;i y2) swap(y1,y2); T->modify(y1,y2-1,delta); //for(int j=0;j query(j,j); //cout< query(j,j)< query(0,ys.size()-2); // cout< >n){ if (!n) break; rects.clear(); for(int i=0;i >x1>>y1>>x2>>y2; rects.push_back(Rectangle(x1,y1,x2,y2)); } cout<<"Test case #"<<++cas<