算法竞赛备忘录

有些坑要记一下,应该不会忘,但是随便写写


ceil(a/b) with int

如果a,b均为int/long long,那么直接使用ceil(a/b)不行,因为a/b作为中间过程是int,会被trunc。

但是使用ceil((double)a / (double)b)还是不行,因为浮点数精度不行,总有你意想不到的奇怪意外。

Read more

OpenWRT配置备忘录

记录一下怎么在上海科技大学内网配置openwrt来使用一些插件,以后可能还会用到。

已经丢了一次配置,绝对不能再丢一次了。


NAT和校园网登录设置

  1. DHCP/DNS 关闭重绑定保护,上科大的网关用了挟制来打开认证页面,不关闭打不开认证。
Read more

Config on Remote Development 用服务器写项目

Start to develop on server so some config to easy the workload is pretty important.


ssh

先配ssh免密登录,第一次需要输入服务器密码

1
2
ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/key.pub root@xxx.xxx.xx.xx
Read more