Submission #1083099

#TimeUsernameProblemLanguageResultExecution timeMemory
1083099toast12Kaučuk (COCI21_kaucuk)C++14
50 / 50
0 ms456 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int n; cin >> n; int sec = 0, subsec = 0, subsubsec = 0; for (int i = 0; i < n; i++) { string s; cin >> s; string x; cin >> x; if (s == "section") { sec++; cout << sec << ' ' << x << '\n'; subsec = 0, subsubsec = 0; } else if (s == "subsection") { subsec++; cout << sec << '.' << subsec << ' ' << x << '\n'; subsubsec = 0; } else { subsubsec++; cout << sec << '.' << subsec << '.' << subsubsec << ' ' << x << '\n'; } } 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...