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<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int cnt[3] = {};
for(int i = 0; i < n; i ++)
{
string s, t;
cin >> s >> t;
if(s == "section")
{
cnt[0]++, cnt[1] = cnt[2] = 0;
cout << cnt[0] << ' ' << t;
}
else if(s == "subsection")
{
cnt[1]++, cnt[2] = 0;
cout << cnt[0] << '.' << cnt[1] << ' ' << t;
}
else
{
cnt[2]++;
cout << cnt[0] << '.' << cnt[1] << '.' << cnt[2] << ' ' << t;
}
cout << 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... |