一道数学的ACM题.1514:x + 2y + 3z = nTime Limit:1000MS Memory Limit
来源:学生作业帮 编辑:大师作文网作业帮 分类:英语作业 时间:2024/09/21 15:47:00
一道数学的ACM题.
1514:x + 2y + 3z = n
Time Limit:1000MS Memory Limit:65536K
Total Submit:229 Accepted:52
[Submit] [Status] [Discuss]
Font Size:Aa Aa Aa
Description
This problem is so easy:given an positive integer n,you are to find the number of solutions of the equation
x + 2y + 3z = n
where x,y,z are nonnegative integers.
Input
The input contains several lines of a positive integer n ( n < 10^6 ) followed by a zero.
Output
For each positive integer in the input output the number of solutions of the equation.
Sample Input
1
6
0
Sample Output
1
7
代码如下:
#include
#include
void solve(int x)
{
int i;
__int64 ans=0;
for (i=0;i*3
1514:x + 2y + 3z = n
Time Limit:1000MS Memory Limit:65536K
Total Submit:229 Accepted:52
[Submit] [Status] [Discuss]
Font Size:Aa Aa Aa
Description
This problem is so easy:given an positive integer n,you are to find the number of solutions of the equation
x + 2y + 3z = n
where x,y,z are nonnegative integers.
Input
The input contains several lines of a positive integer n ( n < 10^6 ) followed by a zero.
Output
For each positive integer in the input output the number of solutions of the equation.
Sample Input
1
6
0
Sample Output
1
7
代码如下:
#include
#include
void solve(int x)
{
int i;
__int64 ans=0;
for (i=0;i*3
for (i=0;i*3
一道数学的ACM题.1514:x + 2y + 3z = nTime Limit:1000MS Memory Limit
一道acm题,Delete NumberTime Limit:1000MS Memory Limit:65536KTot
一道acm题,Problem H:Groups (I)Time Limit:1000MS Memory Limit:65
ACM题一道,原题 zstuoj2511Delete NumberTime Limit:1000MS Memory Li
ACM的 “顺”序列 Time Limit:1000MS Memory Limit:32768K
C语言一道简单的题目An Easy ProblemTime Limit:1000MS Memory Limit:6553
新手请教ACM水题Q - 数据的交换输出Time Limit:1000MS Memory Limit:32768KB 6
C++ACM竞赛题植树节 Time Limit:1000MS Memory Limit:32768KDescriptio
ACM Block world Time Limit:1000ms Memory Limit:65536kb Descr
一道c语言题目棋盘上的距离Time Limit:1000MS Memory Limit:65536KTotal Subm
ACM水题,WA了,请问错在哪里了?对称文 Time Limit:1000MS Memory Limit:32768KD
计算题 Time Limit: 1000MS Memory limit: 65536K