摘要: 最近有一个项目需要迁移,要把文件全部转换成utf8格式的,本来想用python,后来听说PowerShell很是强大,就试着用了一下,果然好用啊! $list = Get-ChildItem .\ -recurse *.java|%{$_.FullName}$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False)foreach... 阅读全文
posted @ 2014-04-19 19:51 thermal 阅读(1992) 评论(1) 推荐(3) 编辑
摘要: 题目连接 题意:你要从起点经过绳子荡到终点,每次你必须抓住另一个绳子,在空中不能向下爬。问是否有合理的方案 做法: 直接模拟 #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll;using na... 阅读全文
posted @ 2014-03-12 20:01 thermal 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2818 题意:给定N个blocks,分在N个堆里,然后又P个操作,每次将x所在的堆放在y所在的堆上,或者询问x的下面有几个blocks 做法:带权并查集 因为要查询x的下面有多少blocks,所以我们在普通并查集的基础上在维护两个域size[x]和under[x],分别表示x所在堆的大小以及x下面的... 阅读全文
posted @ 2014-03-11 20:00 thermal 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=2817 题意: 给定三个数,判断是等差数列还是等比数列,然后输出第k项. 做法:直接判断即可 #include #include #include #include #include #include #include #include #include #include #include typede... 阅读全文
posted @ 2014-03-11 19:16 thermal 阅读(216) 评论(0) 推荐(0) 编辑
摘要: Hackerrank 2020 February 2014 解题报告 比赛链接Sherlock and Watson (20分)题意:给定一个数组,向右平移K次,然后有Q个询问,问第x位置上是几做法:直接模拟即可 1 #include 2 using namespace std; 3 int n,k,q; 4 int a[100100],b[100100]; 5 int main(){ 6 ios::sync_with_stdio(0); 7 cin>>n>>k>>q; 8 for(int i=0;i>a[i]; 10 } 11 for(... 阅读全文
posted @ 2014-02-28 23:50 thermal 阅读(939) 评论(0) 推荐(0) 编辑
摘要: A. On Number of Decompositions into Multipliers题目连接:http://codeforces.com/contest/396/problem/A大意:给定n(n 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 typedef long long ll;13 using namespace std;14 const ll mod = 1000000007;1... 阅读全文
posted @ 2014-02-27 14:48 thermal 阅读(452) 评论(0) 推荐(1) 编辑