7 条题解

  • 1
    @ 2024-12-28 15:20:57

    题目直接把我整蒙了。

    #include<bits/stdc++.h>
    #define int long long
    #define INF 0x3f3f3f
    using namespace std;
    int x,zero;
    char c;
    signed main(){
    	cin>>x>>c;
    	int ans;
    	if(x<=1000){
    		if(c=='n')cout<<"8";
    		else cout<<"13";
    		return 0;
    	}
    	if(x%500)ans=((x-1000)/500+1)*4+8;
    	else ans=((x-1000)/500)*4+8;
    	if(c=='y')ans+=5;
    	cout<<ans;
    	return 0;
    }
    
  • 0
    @ 2025-8-5 11:11:13

    看我超长表达式!!!

    #include<iostream>
    #include<cmath>
    #define QwQ return 0;
    using namespace std;
    int n;
    char ch;
    int ans;
    int main(){
    	cin>>n>>ch;
    	ans+=8+(n>1000?ceil((n-1000)*1.0/500)*4:0)+(ch=='y'?5:0);
    	cout<<ans;
    	QwQ
    }
    
    • 0
      @ 2024-12-28 11:47:38
      #include<bits/stdc++.h>
      using namespace std;
      int main(){
          int m,n;
      	char c;
      	cin>>m>>c;
      	if(m>1000)n=8+ceil((m-1000)/500.0)*4;
      	else n=8;
      	if(c=='y')n=n+5;
      	cout<<n<<endl; 
      	return 0; 
      }
      
      • 0
        @ 2024-12-24 21:14:03

        分段计费+是否加急。

        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int n,k=8;
        	char a;
        	cin>>n>>a;
        	if(a=='y')
        		k+=5;
        	if(n>1000)
        	{
        		n=n-1000;
        		k+=n/500*4;
        		if(n%500!=0)
        		{
        			k+=4;
        		}
        	}
        	cout<<k;
        	return 0;
        }
        
        • 0
          @ 2024-12-22 11:03:53

          C++ :

          #include<bits/stdc++.h>
          using namespace std;
          int main(){
          	int a,c,d,e;
          	char b;
          	cin>>a>>b;
          	if(a<=1000&&b=='y'){
          		c=8+5;
          		cout<<c;
          	}
          	else if(a<=1000&&b=='n'){
          		c=8;
          		cout<<c;
          	}
          	else if(a>1000&&b=='n'){
          		d=(a-1000)/500;
          		e=(a-1000)%500;
          		if(e!=0){
          			d+=1;
          		}
          		c=d*4+8;
          		cout<<c;
          	}
          	else{
          		d=(a-1000)/500;
          		e=(a-1000)%500;
          		if(e!=0){
          			d+=1;
          		}
          		c=d*4+8+5;
          		cout<<c;
          	}
          }
          

          Python :

          # coding=utf-8
          x,y=input().split()
          x=int(x)
          s=0
          if x<=1000:
              s=8
          else:
              if (x-1000)%500==0:
                  s=8+(x-1000)//500*4
              else:
                  s=8+(x-1000)//500*4+4
          if y=='y':
              s=s+5
          print(s)
          
          • -1
            @ 2025-12-14 21:06:56

            #include<bits/stdc++.h> #define int long long #define INF 0x3f3f3f using namespace std; int x,zero; char c; signed main(){ cin>>x>>c; int ans; if(x<=1000){ if(c=='n')cout<<"8"; else cout<<"13"; return 0; } if(x%500)ans=((x-1000)/500+1)*4+8; else ans=((x-1000)/500)*4+8; if(c=='y')ans+=5; cout<<ans; return 0; }

            • @ 2026-2-28 10:50:14

              你就不能排一下版吗???

          • -2
            @ 2025-12-14 21:07:43

            #include<bits/stdc++.h> #define int long long #define INF 0x3f3f3f using namespace std; int x,zero; char c; signed main(){ cin>>x>>c; int ans; if(x<=1000){ if(c=='n')cout<<"8"; else cout<<"13"; return 0; } if(x%500)ans=((x-1000)/500+1)*4+8; else ans=((x-1000)/500)*4+8; if(c=='y')ans+=5; cout<<ans; return 0; }

            • 1

            信息

            ID
            20
            时间
            1000ms
            内存
            128MiB
            难度
            2
            标签
            递交数
            101
            已通过
            62
            上传者