3 条题解

  • 0
    @ 2022-04-01 20:55:00
    #include <iostream>
    #include <functional>
    
    using namespace std;
    
    int main()
    {
        int n; cin >> n;
        n = 100 - n;
        int cnt(0);
        function<void(int&, int)> Main = [=](int& cnt, int x) -> void {
            for (int i = 0; i <= 20; i ++ )
                for (int j = 0; j <= 50; j ++ )
                    if (5 * i + 2 * j == x)
                        printf("%d %d\n", i, j), cnt ++ ;
        };
        Main(cnt, n);
        if (!cnt) puts("N");
        return 0;
    }
    
  • 0
    @ 2019-04-19 14:46:32

    转自毛老师的穷举法
    n=100-int(input())
    if n==1 or n==3:
    print("N")

    else:
    for a in range(n//5+1):
    for b in range(n//2+1):
    if(5*a+b*2==n):
    print(a,b)

  • 0
    @ 2019-04-04 22:17:47

    c=5
    d=0
    a=int(input())
    b=a
    if a<97 or a==98:
    if a%2==0:
    while b<=100:
    c=(100-b)/2
    print(int(d), int(c))
    b=b+10
    d=d+2
    else :
    if a<=95:
    b=a+5
    while b<=100:
    c=(100-b)/2
    print(int(d+1), int(c))
    b=b+10
    d=d+2
    else :
    print("N")

    haoren

  • 1

信息

难度
7
分类
(无)
标签
(无)
递交数
381
已通过
59
通过率
15%
被复制
2
上传者