题意:给定一个n,求前 n 个正整数,正奇数,正偶数之和. 析:没什么好说的,用前 n 项和公式即可. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include…
http://acm.fzu.edu.cn/problem.php?pid=2182 Problem 2182 水题 Accept: 188    Submit: 277Time Limit: 1000 mSec    Memory Limit : 32768 KB  Problem Description 胖哥自从当上公务员,赢取白富美,走向人生巅峰后,已经懒散到不想出题了,不仅如此,他连题目都懒得看了,现在他只会根据题目第一个单词的长度判定这个题目的难度 如果题目的第一个单词太长(长度大于3…
这道题的题目描述灰常简单,第一眼看以为是一道十分水的题目: 但是!!!(我仔细一看也没有发现这背后隐藏着可怕的真相~) 下面给出题目描述: 给出一个整数x,你可以对x进行两种操作.1.将x变成4x+32.将x变成8x+7问,最少通过多少次操作,使得x是1000000007的倍数? 没错,就是这么坑!当我仔细读完题目后本还抱有几分希望(也许可以水过) 但是!!!没错我又一次用了"但是"这个词: 当我看到数据范围时我几乎就放弃了,只能用暴力来骗分了,仅仅只水到了50分(也知足了) [输入格…
Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][Status][Web Board] Description Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. I…
一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar ever faced was keeping himself alive. In order for him to survive, he decided to create one of the first ciphers. This cipher was so incredibly sound, th…
    A+B Problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 311263   Accepted: 171333 Description Calculate a+b Input Two integer a,b (0<=a,b<=10) Output Output a+b   Sample Input 1 2 Sample Output 3 计算两个整数的和 解决思路 这是经典水题了,每个OJ必有的.题目…
本来是不打算贴这道水题的,自己却WA了三次.. 要考虑1的情况,1的质因子为1 思路:先打表 ,然后根据最大质因子更新结果 代码: #include<iostream> #include<cstdlib> #include<cstdio> #include<cstring> using namespace std; #define MAX 20000 int p[MAX]; int main() { memset(p,,sizeof(p)); p[]=; ;…
1841: so easy!麻麻再也不用担心我的数学了! Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 27  Solved: 15 SubmitStatusWeb Board Description 咱们来一发so easy的数学题,这样麻麻再也不用担心我们的数学不及格了. 现在给你一个方程A[i] = (A[i-1]+A[i+1])/2 - c[i](1 <= i <= n);, 然后给你A[0]和A[n+1] 求A[1] = ?. Inp…
Problem Description As is known to all, Sempr(Liangjing Wang) had solved more than 1400 problems on POJ, but nobody know the days and nights he had spent on solving problems. Xiangsanzi(Chen Zhou) was a perfect problem solver too. Now this is a story…
题目大意: yuebai has a long sequence of integers A1,A2,-,AN. He also has such a function: F(x)=∑i=1N(⌊Aix⌋+Aimodx) x is a positive integer, which determined by yuebai. Now he wants to know the minimum value of the function. 求一个x 使F[x]最大 解: 从1枚举到10^6 可知 当…