水题
Tim_Zhi
这个作者很懒,什么都没留下…
展开
-
HDU-2535 Vote 水题
注意点: 有两层条件: 1. 支持州数大于半数 2. 每个州中的选票数大于半数计算:简单的向上取整#include <iostream> #include <algorithm>using namespace std;const int N = 101;int main() { int n; int county; int vote; int i;原创 2015-03-25 22:42:37 · 505 阅读 · 0 评论 -
HDU-2503 a/b + c/d 水题 GCD
大水题,主要存一下GCD和LCM的模板,方便下次直接用。#include <iostream>using namespace std;int GCD(int num1,int num2)//最大公约数 { if (num1 % num2 == 0) return num2; else return GCD(num2, num1 % num2); }//int LCM(int a,int原创 2015-03-20 15:23:37 · 447 阅读 · 0 评论 -
HDU-2674 N!Again 水题
水题,注意2009能被41整除,所以n>40不用算,否则TLE#include <iostream>using namespace std;long long fact(long long n) { if( n == 0 ) return 1; if( n > 40) return 0; long long ans = 1, i; fo原创 2015-04-04 10:40:21 · 422 阅读 · 0 评论 -
HDU-2134 Cuts the cake 水题 数学题
思路:每块蛋糕面积相等AC代码:#include <iostream>using namespace std;int main() { int R; while(~scanf("%d", &R) && R) { printf("%.3f %.3f\n",R*0.57735026918963, R*0.81649658092773); } retu原创 2015-07-19 15:37:09 · 488 阅读 · 0 评论 -
HDU-2140 Michael Scofield's letter 水题
大水题#include <iostream>using namespace std;int main() { char a; while(~scanf("%c", &a)) { switch(a) { case 'b' : printf(" "); break; case 'q' : printf原创 2015-07-19 15:55:09 · 537 阅读 · 0 评论