4 solutions
-
2
#include<bits/stdc++.h> using namespace std; int main() { int a; char b; cin>>a>>b; if(a<=1000) { if(b=='y') { cout<<13; } else { cout<<8; } } else { int n=a-1000; if(n%500!=0) { int z; if(b=='y') { z=5; } else { z=0; } int x=n/500; cout<<8+(x+1)*4+z; } else { int z; if(b=='y') { z=5; } else { z=0; } int x=n/500; cout<<8+x*4+z; } } return 0; }
- 1
Information
- ID
- 857
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 3
- Tags
- (None)
- # Submissions
- 370
- Accepted
- 77
- Uploaded By