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;
#define int long long
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
signed main()
{
speed;
int q;
cin >> q;
long double se = 0, sb = 0, sbs = 0;
while(q--)
{
string type, s;
cin >> type >> s;
if(type == "section")
{
se++;
sb = 0, sbs = 0;
cout << se << " " << s << "\n";
}
else if(type == "subsection")
{
sb++;
cout << se << "." << sb << " " << s << "\n";
}
else
{
sbs++;
cout << se << "." << sb << "." << sbs << " " << s << "\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... |