Submission #724502

#TimeUsernameProblemLanguageResultExecution timeMemory
724502TahirAliyevKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms212 KiB
#include <bits/stdc++.h> #pragma GCC optimize("O3") using namespace std; #define ll long long int #define oo 1e18 + 5 #define pii pair<int, int> int main(){ int n; cin >> n; int sec = 0; int subsec = 0; int subsubsec = 0; for(int i = 0; i < n; i++){ string id; cin >> id; string s; cin >> s; if(id == "section"){ cout << sec + 1 << ' ' << s << '\n'; sec++; subsec = 0; subsubsec = 0; } else if(id == "subsection"){ cout << sec << '.' << subsec + 1 << ' ' << s << '\n'; subsec++; subsubsec = 0; } else{ cout << sec << '.' << subsec << '.' << subsubsec + 1 << ' ' << s << '\n'; subsubsec++; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...