Submission #497128

#TimeUsernameProblemLanguageResultExecution timeMemory
497128Abrar_Al_SamitKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms312 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...