Submission #1028515

#TimeUsernameProblemLanguageResultExecution timeMemory
1028515atomKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms456 KiB
#include "bits/stdc++.h" // @JASPER'S BOILERPLATE using namespace std; using ll = long long; #ifdef JASPER #include "debug.h" #else #define debug(...) 166 #endif signed main() { cin.tie(0) -> sync_with_stdio(0); #ifdef JASPER freopen("in1", "r", stdin); #endif int n; cin >> n; int c1 = 0, c2 = 0, c3 = 0; for (int i = 1; i <= n; ++i) { string cmd, s; cin >> cmd >> s; if (cmd == "section") { ++c1; c2 = c3 = 0; cout << c1 << " " << s << "\n"; continue; } if (cmd == "subsection") { ++c2; c3 = 0; cout << c1 << "." << c2 << " " << s << "\n"; continue; } if (cmd == "subsubsection") { ++c3; cout << c1 << "." << c2 << "." << c3 << " " << s << "\n"; continue; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...