(HDU)1248 -- 寒冰王座

题目链接:http://bak.vjudge.net/problem/HDU-1248

这题其实是完全背包问题的裸题,但是由于数据过于简单,可以找规律。

#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdlib>

using namespace std;

int main()
{
    int t,n;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d",&n);
        if (n<150) printf("%d
",n);
        else if (n>200&&n<300) printf("%d
",n%200);
        else printf("%d
",n%50);
    }
    return 0;
}
原文地址:https://www.cnblogs.com/ACDoge/p/6134545.html