-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathATTIC.cpp
More file actions
41 lines (39 loc) · 863 Bytes
/
ATTIC.cpp
File metadata and controls
41 lines (39 loc) · 863 Bytes
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
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int t;
cin>>t;
while (t--) {
string p;
cin>>p;
map <int,int> Map;
bool jump=false;
int j=0,c=0;
for(int i=0;i<p.size();i++){
if(p[i]=='.' && !jump){
jump=true;
}
if(p[i]=='.' && jump){
c+=1;
}
if(jump && ((p[i]=='#')||i == p.size()-1)){
jump = false;
Map[j++] = c;
c=0;
}
}
int days=0,currentCapa=0;
for( auto i : Map){
if( i.second > currentCapa){
days+=1;
currentCapa = i.second;
}
}
cout<<days<<"\n";
}
return 0;
}