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 n,s=0,ss=0,sss=0;
string op,t;
int main() {
ios::sync_with_stdio(0);cin.tie(0);
cin>>n;
for(int i=1;i<=n;i++) {
cin>>op>>t;
if(op=="section") {
s++;
cout<<s<<' '<<t<<'\n';
ss=sss=0;
} else if(op=="subsection") {
ss++;
cout<<s<<'.'<<ss<<' '<<t<<'\n';
sss=0;
} else {
sss++;
cout<<s<<'.'<<ss<<'.'<<sss<<' '<<t<<'\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... |