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,sec=0,sub=0,ss=0;
cin>>n;
for (int i=1; i<=n; i++)
{
string s,title;
cin>>s>>title;
if (s=="section") {sec++; sub=0; ss=0; cout<<sec<<" "<<title<<"\n";}
else if (s=="subsection") {sub++; ss=0; cout<<sec<<"."<<sub<<" "<<title<<"\n";}
else {ss++; cout<<sec<<"."<<sub<<"."<<ss<<" "<<title<<"\n";}
}
}
# | 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... |