zoukankan      html  css  js  c++  java
  • 致一场我没打的CF

    (color{red}{这场CF我没打~~})


    (color{blue}{所以你写他干嘛???})

    但是我帮忙代打了2333(大嘘)


    (color{green}D)

    代码


    (color{yellow}C)

    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
    " , 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-i);
    			break;
    		}
    	}
    	return 0;
    }
    

    溜了溜了

  • 相关阅读:
    iOS开发之详解剪贴板
    iOS7(Xcode5)中隐藏状态栏的方法
    如何使用iOS手势UIGestureRecognizer
    如何给列表加入搜索功能
    UITabBarController 相关
    UIButton 相关
    UINavigationController 相关
    Apple Watch 会再一次改变世界么?
    编译VLC for IOS
    ffmpeg Win8移植记(二)
  • 原文地址:https://www.cnblogs.com/lyt020321/p/11461585.html
Copyright © 2011-2022 走看看