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;
void PlayGround() {
int sec = 0, sub = 0, subsub = 0;
int n; cin >> n;
while(n--) {
string com, s; cin >> com >> s;
if(com=="section") {
++sec, sub = subsub = 0;
cout << sec << ' ' << s << '\n';
} else if(com=="subsection") {
++sub, subsub = 0;
cout << sec << "." << sub << ' ' << s << '\n';
} else {
++subsub;
cout << sec << '.' << sub << '.' << subsub << ' ' << s << '\n';
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
PlayGround();
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... |