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