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 ;
const int MAX = 1e5 + 10 ;
int arr[MAX] ;
int n ;
int main()
{
ios_base::sync_with_stdio(0) ;
cin.tie(0) ;
cin>>n ;
int cnt1 = 0 , cnt2 = 0 , cnt3 = 0 ;
for(int i = 0 ; i < n ; ++i)
{
string s1 , s2 ;
cin>>s1>>s2 ;
if(s1 == "section")
{
++cnt1 , cnt2 = cnt3 = 0 ;
cout<<cnt1<<" " ;
}
else if(s1 == "subsection")
{
++cnt2 , cnt3 = 0 ;
cout<<cnt1<<"."<<cnt2<<" " ;
}
else if(s1 == "subsubsection")
{
++cnt3 ;
cout<<cnt1<<"."<<cnt2<<"."<<cnt3<<" " ;
}
cout<<s2<<"\n" ;
}
return 0 ;
}
# | 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... |