其他分享
首页 > 其他分享> > 白条取现怎么取不了呀

白条取现怎么取不了呀

作者:互联网

花呗、白条\/信客服:[3 3 1 5 7 5 6 4 4],分期乐提现,xin用卡秒提,、来分期、安逸花、任性付各种额度提现,花呗、白条\/信客服:[3 3 1 5 7 5 6 4 4]专业迅速秒回款,可当面操作,可远程操作!流程简单回款迅速,操作专业不卡单几分钟就搞定!

Polycarp is sad — New Year is coming in few days but there is still no snow in his city. To bring himself New Year mood, he decided to decorate his house with some garlands.

The local store introduced a new service this year, called "Build your own garland". So you can buy some red, green and blue lamps, provide them and the store workers will solder a single garland of them. The resulting garland will have all the lamps you provided put in a line. Moreover, no pair of lamps of the same color will be adjacent to each other in this garland!

For example, if you provide 3 red, 3 green and 3 blue lamps, the resulting garland can look like this: "RGBRBGBGR" ("RGB" being the red, green and blue color, respectively). Note that it's ok to have lamps of the same color on the ends of the garland.

However, if you provide, say, 1 red, 10 green and 2 blue lamps then the store workers won't be able to build any garland of them. Any garland consisting of these lamps will have at least one pair of lamps of the same color adjacent to each other. Note that the store workers should use all the lamps you provided.

So Polycarp has bought some sets of lamps and now he wants to know if the store workers can build a garland from each of them.

思路:

先把最大的摆出来,然后再相邻的中间插,如果不能全部分割就不行。

代码:

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int a[3];
        cin >> a[0] >> a[1] >> a[2];
        sort(a, a+3);
        if (a[2]-1 > a[0]+a[1])
            puts("No");
        else
            puts("Yes");
    }

    return 0;
}

标签:them,不了,garland,color,workers,取现,lamps,白条,store
来源: https://www.cnblogs.com/dfdf55/p/12113543.html