-
Notifications
You must be signed in to change notification settings - Fork 0
/
day8Problem2.cpp
32 lines (20 loc) · 967 Bytes
/
day8Problem2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
Problem statement 2
Difficulty: Easy
You are playing GTA 5. You want to raise the wanted level to X. So you start running over every being on the footpath. There are 3 types of beings on the footpath policeman, member of the mob and cats.
The rule is simple if you run over a policeman your wanted level increase by 1, if you run over 3 consecutive members of the mob your wanted level increase by 1 and if you run over 5 consecutive cats your wanted level increase by 1.
If running over one being takes 1 sec, find how much time it will take to reach wanted level X.
You are given a string that represents a footpath. 'P' represents a policeman, 'M' represents member of a mob and 'C' represents cat.
Test case 1
Input
5 8 -> wanted level and length of the string
PMMMPPMP
Output
8 -> it will take 8 seconds
*/
#include <iostream>
using namespace std;
int main(){
int w,l;
cin >> w >> l;
}