首先要求出三种等价情况

5×1+1×50=1×5+5×105×1+1×50=1×5+5×10
9×5=5×1+4×10
8×5+1×50=9×10
 
那么可以求出三种关于x5,x10的不可行条件
x5 ≥ 1 且 x10 ≥ 5
x5 ≥ 9
x10 ≥ 9
那么只要依次枚举这x5,x10的可能的取值,用不定方程的解数量累计即可
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
long long ans = ;
for (int i = ; i <= && i <= n; i++)
{
for (int j = ; j <= (i == ? : ) && i + j <= n; j++)
{
ans += n + - i - j;
}
}
cout << ans << endl;
}
return ;
}
 

最新文章

  1. Spring源码分析——BeanFactory体系之抽象类、类分析(二)
  2. ecplise常用快捷键
  3. JS实现验证码倒计时效果
  4. Pyunit测试框架
  5. Maven+Spring+Spring MVC+MyBatis+MySQL,搭建SSM框架环境
  6. ProcExp和TaskMgr的列对比
  7. Spring IoC小结
  8. ! cocos2d sprintf的问题
  9. External Table
  10. shell中使用echo命令改变输出显示样式
  11. Jquery 进度条集锦
  12. 【LuaJIT版】从零开始在 macOS 上配置 Lua 开发环境
  13. performance数据
  14. string函数详解(配案例)
  15. Python3 Selenium多窗口切换
  16. Palindromic characteristics CodeForces - 835D (区间DP,预处理回文串问题)
  17. [LeetCode&amp;Python] Problem 744. Find Smallest Letter Greater Than Target
  18. Unreal Engine 4 C++ UCLASS构造函数易出错分析
  19. linux中crontab的使用方法
  20. meterpreter 如何留后门,使攻击持久化

热门文章

  1. 阿里云 Server (Ubuntu 12.04) 配置 FTP
  2. es6注意点
  3. OpenGL的编译和使用
  4. 新项目UX设计0到1的正确开启方式
  5. centos6.8 oracle 11.2.0.4 11g安装
  6. Bash 脚本 set 命令教程
  7. Codeforces 1140E DP
  8. activemq启动失败修改Linux服务器名称
  9. Java判断链表是否为回文链表
  10. ul -- li 模拟select下拉框