代码

 1 #include<cstdio>
 2 #include<iostream>
 3 #include<cstring>
 4 using namespace std;
 5 int co,cx,mo,mx;
 6 int main(){
 7     freopen("bs.in","r",stdin);
 8     freopen("bs.out","w",stdout);
 9     while(scanf("%d%d%d%d",&co,&cx,&mo,&mx)==4){
10         int ans=0;
11         if(mo==0) {cout<<min(mx,cx);continue;}
12         if(mx==0) {cout<<min(mo,co);continue;}
13         if(co>cx) {swap(co,cx);swap(mo,mx);}
14         ans+=co*2+1;
15         ans+=min((cx-co-1),(co+1)*(mx-1));
16         cout<<ans<<endl;
17     }
18     return 0;
19 }

额额额额额

posted @ 2019-02-25 14:51  一抹清舟  阅读(64)  评论(0)    收藏  举报