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;
typedef long long ll;
#define ssize(a) ((int)(a.size()))
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int nrs = 0, nrss = 0, nrsss = 0;
for(int i = 0; i < n; ++i)
{
string s1, s2;
cin >> s1 >> s2;
if(s1 == "section")
{
++nrs;
nrss = 0;
nrsss = 0;
cout << nrs << " ";
}
else if(s1 == "subsection")
{
nrsss = 0;
++nrss;
cout<< nrs << "." << nrss << " ";
}
else
{
++nrsss;
cout<< nrs << "." << nrss << "." << nrsss << " ";
}
cout << s2 << "\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... |