摘要: 纯粹数学题,推公式吧。注意边界处理精度控制就可以了。 #include #include #define EPS 1e-7int main(){ int T; scanf("%d", &T); while (T--){ double a, b, S; scanf("%lf %lf %lf", ... 阅读全文
posted @ 2015-03-03 23:26 Popco 阅读(132) 评论(0) 推荐(0)
摘要: 比较水的一题,找到方法就好说了。 #include using namespace std;char tab[128][128];int main(){ int h, w; while (cin >> h >> w){ cin.get(); for (int i = 0; i > tab[i... 阅读全文
posted @ 2015-03-03 22:51 Popco 阅读(144) 评论(0) 推荐(0)
摘要: 通过这题学习了线性筛法素数打表的方法,题目本身更像数学思考题。 #include #include #include #include #include using namespace std;using LL = long long int;const int maxn = 1024000;b... 阅读全文
posted @ 2015-03-03 21:59 Popco 阅读(192) 评论(0) 推荐(0)
摘要: 基础题,就用基本方法即可,计算约数时算到sqrt(n)即可,要注意(int)sqrt(n)和n的关系。 #include #include #include using namespace std;int main(){ int T; cin >> T; while (T--){ int L,... 阅读全文
posted @ 2015-03-03 16:06 Popco 阅读(141) 评论(0) 推荐(0)
摘要: 用打表的方法来做,蕴含着一种递推的思想。 #include #include using namespace std;int n, res[1024];const int MOD = 1e9 + 7;void init() { res[1] = res[2] = 1; for (int i = ... 阅读全文
posted @ 2015-03-03 15:13 Popco 阅读(163) 评论(0) 推荐(0)
摘要: 纯粹找规律的一小学数学题,空格处的数可有输入计算得出,每个6格三角形为一个计算单位。 #include #include using namespace std;int tab[10][10];int main(){ int T; cin >> T; while (T--){ for (int... 阅读全文
posted @ 2015-03-03 13:25 Popco 阅读(199) 评论(0) 推荐(0)