A. If at first you don’t succeed…
- 题意:
给你A,B,C集合的大小,求D集合的大小 - 链接:http://codeforces.com/contest/991/problem/A
- AC code:
#include<iostream>
using namespace std;
int main(){
int a,b,c,n;cin>>a>>b>>c>>n;
int ans=n-(a-c+b);
if(c<=a&&c<=b){
if(ans<1)cout<<-1<<endl;
else cout<<ans<<endl;
}
else cout<<-1<<endl;
}