摘要: 这题本来完全没思路的,后来想一想,要不打个表找找规律吧。于是打了个表,真找到规律了。。。打表的代码如下:int n;void dfs(int x1, int y1, int x2, int y2) { if (y1 + y2 <= n) { dfs(x1, y1, x1 + x2, y1 + y2); printf("%d/%d\n", x1 + x2, y1 + y2); dfs(x1 + x2, y1 + y2, x2, y2); }}void print_farey(int n) { printf("0/1\n"); df... 阅读全文
posted @ 2012-11-05 22:14 moonbay 阅读(354) 评论(0) 推荐(0)
摘要: 这题是大水题。不过我用了一种比较诡异的写法,也不是为了装逼,主要是为了熟悉一下bitset的用法以及数据类型的转换。/* * hdu2207/win.cpp * Created on: 2012-11-5 * Author : ben */#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>#include <ctime>#include <iostream>#include <algorithm>#include <q 阅读全文
posted @ 2012-11-05 14:13 moonbay 阅读(164) 评论(0) 推荐(0)