Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Karatat007
Problemset: Sofa Cat
Language: cpp
Time: 0.102 second
Submitted On: 2026-10-24 14:17:19
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int v = 1;
for(int i = 1;i <= n;++i){
string s;
cin >> s;
if(s == "oia"){
int count = 0;
while(count < 3){
char c;
cin >> c;
if(c == 'i') count++;
if(c == 'a') v++;
if(c == 'o' and v != 1) v--;
}
}
else{
string meow;
getline(cin,meow);
meow.erase(meow.size() - 6,meow.size() - 1);
for(int i = 0;i < meow.size();++i){
if(meow[i] == ' ')continue;
for(int j = 1;j <= v;++j){
cout << meow[i] << ' ';
}
}
}
}
}