shu_1161 人民币问题

来源:互联网 发布:js map使用 编辑:程序博客网 时间:2024/06/05 18:47

http://202.121.199.212/JudgeOnline/problem.php?cid=1079&pid=17


分析: 因为每种类型的钱币都要存在,所以先减去三种类型的钱币的总数,再暴搜。



代码:

#include <iostream>#include <stdio.h>#include <algorithm>#include <string>#include <string.h>#include <ctype.h>#include <math.h>using namespace std; long long  cnt;long long deal(long long e){    long long tmp=0;    long long x=e-8;    for(int i=0;i<=x;i+=5){        for(int j=i;j<=x;j+=2){                tmp++;        }    }    return tmp;}int main(){    long long n;    while(scanf("%lld",&n)!=EOF){        cnt=deal(n);        printf("%lld\n",cnt);    }    return 0;}




0 0