题意:

你有一个容量为【l,r】的壶,你要往两个杯子里倒水

水壶你只能判断是否为空

使得最后杯中水相差<=1升,壶中剩余的水<=1升

思路:

这个题简直太遗憾了

当天网络赛的时候我感冒了很难受状态几乎为0

然后学弟最后40分钟左右的时候把这个题跟我说了一下,我当时就想出来正确的思路

提交完后发现杭电已经挂了,然后我就没管了(难受的要回宿舍了)

结果晚上发现结果wa了,看了camp的题解的题意说明。。

非常的无语。。学弟读题理解错了,他认为壶里还剩不到1升水就会报警让你知道

所以我由这个错误的题意推出了除4。。

最近感冒好点补这几次比赛的时候改成除2的思路就AC了

怎么说呢,比较遗憾吧,毕竟弱校,如果出了这题就能晋级了,唉

/* ***********************************************
Author        :devil
************************************************ */
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <string>
#include <cmath>
#include <stdlib.h>
#define inf 0x3f3f3f3f
#define LL long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define dep(i,a,b) for(int i=a;i>=b;i--)
#define ou(a) printf("%d\n",a)
#define pb push_back
#define mkp make_pair
template<class T>inline void rd(T &x){char c=getchar();x=0;while(!isdigit(c))c=getchar();while(isdigit(c)){x=x*10+c-'0';c=getchar();}}
#define IN freopen("in.txt","r",stdin);
#define OUT freopen("out.txt","w",stdout);
using namespace std;
const int mod=1e9+7;
const int N=1e6+10;
int main()
{
    LL l,r;
    while(~scanf("%lld%lld",&l,&r))
    {
        if(r<=1)
        {
            printf("0\n");
            continue;
        }
        if(r<=2)
        {
            printf("1\n");
            continue;
        }
        if(l==0)
        {
            printf("%lld\n",(r+1)/2);
            continue;
        }
        if(r-l<=3)
        {
            printf("2\n");
            continue;
        }
        r=r-l-3;
        LL ans=2;
        ans=ans+r/2;
        if(r%2) ans++;
        printf("%lld\n",ans);
    }
    return 0;
}