Codeforcrs 761 A Dasha and Stairs

On her way to programming school tiger Dasha faced her first test — a huge staircase!

The steps were numbered from one to infinity. As we know, tigers are very fond of all striped things, it is possible that it has something to do with their color. So on some interval of her way she calculated two values — the number of steps with even and odd numbers.

You need to check whether there is an interval of steps from the l-th to the r-th (1 ≤ l ≤ r), for which values that Dasha has found are correct.

Input

In the only line you are given two integers a,b (0 ≤ a, b ≤ 100) — the number of even and odd steps, accordingly.

Output

In the only line print "YES", if the interval of steps described above exists, and "NO" otherwise.

Examples
Input
2 3
Output
YES
Input
3 1
Output
NO
Note

In the first example one of suitable intervals is from 1 to 5. The interval contains two even steps —2 and 4, and three odd:1, 3 and 5.

题意:给你两个数,判断是否有一段区间里有A个偶数且有B个奇数

讲解:很明显啦,数字都是一奇一偶排列的啦,

注意:0 0 的时候需要特判一下


AC代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{
    //freopen("d:\\oj项目\\对拍\\data.txt","r",stdin);
    //freopen("d:\\oj项目\\对拍\\out1.txt","w",stdout);
    int a,b;
    while(scanf("%d%d",&a,&b)!=EOF){
        if(a == 0 && b == 0)
        {
            printf("NO\n");
            continue;
        }
        if(a-1>b||b-1>a){
            printf("NO\n");
        }
        else{
            printf("YES\n");
        }
    }
    return 0;
}

步态相位检测是通过机器学习技术进行步行和上下楼梯的监测和识别。 步态相位是指一个完整步行周期中的不同阶段,包括踏步阶段和摆动阶段。通过准确识别步态相位,我们可以更好地了解个体的步行和运动模式。 使用机器学习方法来进行步态相位检测具有很大的优势。我们可以收集大量的步行和上下楼梯的数据作为训练集,并提取大量的特征,例如步伐周期、步幅、加速度等等。然后,我们可以使用这些特征来训练一个机器学习模型,例如支持向量机、决策树或神经网络模型。 训练完成后,我们可以将模型应用到实际的步行和上下楼梯的数据中,用于步态相位的检测。模型可以通过分析实时传感器数据,例如加速度计和陀螺仪数据,来判断当前的步行阶段。根据模型的输出,我们可以准确地确定个体当前所处的步态相位,从而监测其步行或运动状态。 步态相位检测在临床医学、康复训练和运动健康领域具有广泛的应用。通过检测个体的步态相位,我们可以评估其步行能力、平衡性和运动控制平。对于康复训练,可以帮助康复师确定个体的康复进展和制定更加个性化的康复方案。同时,还可以用于监测运动员的训练状态和预防运动损伤。 总之,利用机器学习技术进行步态相位检测,可以提供准确和实时的步行和上下楼梯监测。这项技术在不同领域具有广泛的应用前景,并有助于改善个体的健康和运动表现。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值