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;
#define ll long long
int const N=2e5+5;
int const mod=1e9+7;
int main(){
int n;
cin>>n;
int s=0,ss=0,sss=0;
for (int i = 0; i < n; ++i)
{
string a,b;
cin>>a>>b;
if(a=="section"){
s++;
ss=0;
sss=0;
}
else if(a=="subsection"){
ss++;
sss=0;
}
else
sss++;
cout<<s;
if(ss!=0){
cout<<'.'<<ss;
if(sss!=0)
cout<<'.'<<sss;
}
cout<<' '<<b<<endl;
}
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... |