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, cnt0 = 0, cnt1 = 0, cnt2 = 0;
cin >> n;
while(n--)
{
string s, s1;
cin >> s >> s1;
if(s == "section")
{
cnt0++;
cnt1 = cnt2 = 0;
cout << cnt0 << " " << s1 << endl;
}
else if(s == "subsection")
{
cnt1++;
cnt2 = 0;
cout << cnt0 << "." << cnt1 << " " << s1 << endl;
}
else
{
cnt2++;
cout << cnt0 << "." << cnt1 << "." << cnt2 << " " << s1 << endl;
}
}
}
# | 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... |