# 致一場我沒打的CF

\(\color{red}{這場CF我沒打~~}\)

# code

``````#include <bits/stdc++.h>
#define maxn 250000
using namespace std ;
int n ,l , r , top ;
char a[maxn] ;
int main () {
cin >> n ;
for(int i = 1 ; i <= n ; i ++) {
cin >> a[i] ;
if(a[i] == '(') l ++ ;
else r ++ ;
}
for(int i = 1 ; i <= n ; i ++) {
if(a[i] == '(' ) top ++ ;
else top -- ;
if(top < -1) {
puts("No") ;
return 0 ;
}
}
if(l != r) {
puts("No") ;
return 0 ;
}else puts("Yes") ;
return 0 ;
}
``````

# \(\color{brown}{B}\)

``````
#include <bits/stdc++.h>
using namespace std ;
int b , g , n , ans ;
int main() {
scanf("%d%d%d",&b,&g,&n);
for(int i = 0 ; i <= n ;i ++) {
if(i > b)
break;
if(n-i > g)
continue;
ans ++ ;
}
printf("%d\n" , ans);
return 0;
}``````

# \(\color{green}{A}\)

``````#include <bits/stdc++.h>
using namespace std ;
int n , d , e , t , s[20] ;
bool f[100000005] ;
int dl[10] = {0,1,2,5,10,20,50,100} ;
int el[10] = {0,5,10,20,50,100,200} ;
int main() {
scanf("%d%d%d",&n,&d,&e);
for(int i = 1 ;i <= 7 ; i ++)
s[++t] = d * dl[i] ;
for(int i = 1 ; i <= 6 ; i ++)
s[++t] = e * el[i] ;
f[0] = 1 ;
for(int i = 1 ; i <= t ; i ++)
for(int j = s[i] ; j <= n ; j ++)
if(f[j-s[i]])
f[j] = 1 ;
for(int i = n ; i >= 0 ; i --) {
if(f[i] == 1) {
printf("%d\n",n-i);
break;
}
}
return 0;
}``````