HDU 1248 寒冰王座

http://acm.hdu.edu.cn/showproblem.php?pid=1248

我乱搞的,标准做法01背包

View Code
#include <stdio.h>
int test(int n)
{
    if(n<150)return n;
    if(n>200&&n<300)return n-200;
    return n%50;
}
int main()
{
    int t,n;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        printf("%d\n",test(n));
    }
    return 0;
}
原文地址:https://www.cnblogs.com/xiaohongmao/p/2443205.html