摘要: #include int main() { int n, m; while(scanf("%d %d", &n, &m) != EOF) { int sum = 0, count = 0; for(int i = 2; i <= 2*n; i += 2) { sum += i; if((i/2) % m == 0) { count ++; ... 阅读全文
posted @ 2019-07-28 22:50 青衫客36 阅读(212) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { int n; while(scanf("%d", &n) != EOF) { double score[n]; double sum = 0; for(int i = 0; i < n; ++ i) { scanf("%lf", &score[i]); ... 阅读全文
posted @ 2019-07-28 22:22 青衫客36 阅读(348) 评论(0) 推荐(0) 编辑
摘要: #include long long int memo[33]; long long int f(long long int n) { memo[1] = 1; for(long long int i = 2; i <= n; ++ i) { memo[i] = 2 * (memo[i - 1] + 1); } return memo[n]; } int main() {... 阅读全文
posted @ 2019-07-28 22:09 青衫客36 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #include #include bool is_prime(int n) { for(int i = 2; i < sqrt(n); ++ i) if(n % i == 0) return false; return true; } int main() { int x, y, sum; while(scanf("%d %d", &x, &y) && (x... 阅读全文
posted @ 2019-07-28 21:38 青衫客36 阅读(136) 评论(0) 推荐(0) 编辑
摘要: #include int main() { int n, m; scanf("%d", &m); while(m --) { scanf("%d", &n); float sum = 0; for(int i = 1; i <= n; ++ i) { if(i % 2 == 0) sum -= 1.0/i; else sum += 1.0/i; }... 阅读全文
posted @ 2019-07-28 21:20 青衫客36 阅读(149) 评论(0) 推荐(0) 编辑