This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x=0,c=0,d=0,u;
string s[5000000];
cin>>n;
u=n+1;
for(int i=0;i<n;i++)
{
cin>>s[i]>>s[u];
if(s[i]=="section")
{
x++;
c=0;
d=0;
cout<<x<<" "<<s[u]<<endl;
}
else if(s[i]=="subsection")
{
c++;
d=0;
cout<<x<<"."<<c<<" "<<s[u]<<endl;
}
else if(s[i]=="subsubsection")
{
d++;
cout<<x<<"."<<c<<"."<<d<<" "<<s[u]<<endl;
}
u++;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |