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>
#pragma GCC optimize("O3")
#define ll long long
#define oo 1e9 + 9
#define pii pair<ll, ll>
using namespace std;
int main(){
int a = 0, b = 0, c = 0;
int n; cin >> n;
for (int i = 0; i < n; i++)
{
string q, s; cin >> q >> s;
if(q == "section"){
a++;
b = 0;
c = 0;
}
else if(q == "subsection"){
b++;
c = 0;
}
else{
c++;
}
cout << a;
if(b) cout << '.' << b;
if(c) cout << '.' << c;
cout << ' ';
cout << s << '\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... |