#include <bits/stdc++.h>
using namespace std;
int k = 0;
int n;
int main() {
string st;
cin >>st;
for(int i = 0; i < (int)st.size(); i++) {
if(st[i] == 'T'){
k++;
}
}
cin >>n;
cout<<min(st.size()-k+n,st.size()-n+k);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
8 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
9 |
Incorrect |
2 ms |
292 KB |
Output isn't correct |
10 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
11 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
12 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
13 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
14 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
15 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
16 |
Incorrect |
2 ms |
380 KB |
Output isn't correct |
17 |
Incorrect |
13 ms |
376 KB |
Output isn't correct |
18 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
19 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
20 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |