1 条题解

  • 0
    @ 2025-4-5 18:34:53
    #include<bits/stdc++.h>
    using namespace std;
    int f(int x,char c){
    	if(c=='y'){
    		if(x<=1000){
    			return 8+5;
    		}
    		if(x>1000){
    			if((x-1000)%500==0){
    				return (x-1000)/500*4+8+5;
    			}else{
    				return ((x-1000)/500+1)*4+8+5;
    			}
    			
    		}	
    	}else{
    		if(x<=1000){
    			return 8;
    		}
    		if(x>1000){
    			if((x-1000)%500==0){
    				return (x-1000)/500*4+8;
    			}else{
    				return ((x-1000)/500+1)*4+8;
    			}
    		}	
    	}
    }
    int main(){
    	int n;char c;
    	cin>>n>>c;
    	printf("%d",f(n,c));
    	return 0;
    }
    
    • 1

    信息

    ID
    122
    时间
    1000ms
    内存
    128MiB
    难度
    4
    标签
    递交数
    23
    已通过
    16
    上传者