This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*#pragma GCC optimize("O3")
#pragma GCC target ("avx2")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")*/
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n, a1, a2, a3;
signed main () {
// freopen("visitfj.in", "r", stdin);
// freopen("visitfj.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n;
for (int i = 1; i <= n; i++) {
string x, y;
cin >> x >> y;
if (x == "section") {
cout << ++a1 << ' ' << y << '\n';
a2 = a3 = 0;
} else if (x == "subsection") {
cout << a1 << '.' << ++a2 << ' ' << y << '\n';
a3 = 0;
} else if (x == "subsubsection") {
cout << a1 << '.' << a2 << '.' << ++a3 << ' ' << y << '\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... |