题目
一道数学的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
提问时间:2021-04-01
答案
for (i=0;i*3
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1一束与水面成50°夹角的光线从空气斜射入水中,则折射角( ) A.小于50° B.大于50° C.大于40° D.小于40°
- 2我的目的片段连T载体后,挑单克隆摇菌,用菌液PCR能P出目的片段,再提质粒用Ecor1做酶切,片段变小怎么回
- 3长方形时钟的中心在对角线交点上,长方形的宽为20厘米,钟面数字2、4、8、10在四个顶点处,求长为多少?
- 4已知a,b属于R,求证a的平方-ab大于等于ab-b的平方
- 5证明对于任意向量a,b都有| |a|-|b| |≤|a-b|≤|a|+|b|,并指出等号成立的条件
- 6英语作文“how do you make frait salad” 50字左右
- 7某小学准备在草坪边树一块警示牌,意思是提醒同学们不要踩草坪,老师们都不赞成用"禁止进入"、"严禁践踏"
- 8作文500字 什么改变了我
- 9根号17/根号68
- 10用现在完成时写5句有关旅途中的所见所闻.
热门考点