Submission
Status:
P---------
Subtask/Task Score:
10/100
Score: 10
User: hmmm
Problemset: Sofa Cat
Language: cpp
Time: 0.004 second
Submitted On: 2025-08-02 21:54:04
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0); cin.tie(0);
int n,chk=0;
cin >> n;
vector<char> p;
while(n--){
string s;
cin >> s;
p.clear();
if(s=="oii"){
int cnt=0;
char a;
while(cin >> a){
if(a=='i') cnt++;
else cnt=0;
if(cnt==3) break;
p.push_back(a);
}
p.pop_back();
p.pop_back();
}
else{
chk++;
int cnt=0;
char a;
while(cin >> a){
if(a=='i') cnt++;
// p.push_back(a);
if(cnt==3) break;
}
}
// for(auto e:p) cout << e << ' ';
// cout << "\n";
if(chk%2==0){
for(auto e:p) cout << e << ' ';
}
else{
for(auto e:p){
for(int i=1;i<=1;i++){
cout << e << ' ';
}
}
}
}
}