4 solutions

  • 1
    @ 2025-3-19 19:43:04
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int w;
    	char ch;
    	cin>>w>>ch;
    	int c=8;
    	w=w-1000;
    	if(w>0)
    	{
    		int t=(w+500-1)/500;
    		c=c+t*4;
    	}
    	if(ch=='y')
    	{
    		c=c+5;
    	}
    	cout<<c;
    	return 0; 
    }
    

    Information

    ID
    857
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    370
    Accepted
    77
    Uploaded By