CF1214B
解法:
暴力枚举,时间复杂度 $ O(n) $
CODE:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
#define LL long long
#define N 100010
int r,b,n,ans;
int main() {
scanf("%d%d%d",&b,&r,&n);
for(int i = 0 ; i <= n ; i++) {
int j = n - i;
if(i > b) continue;
if(j > r) continue;
ans++;
}
printf("%d
",ans);
//system("p
return 0;
}