Submission #499439

#TimeUsernameProblemLanguageResultExecution timeMemory
499439Haboosh915Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n ; cin >> n ; string s = "section" , ss = "subsection" , sss = "subsubsection" ; int v = 0 , vv = 0 , vvv = 0 ; for (int i = 1; i <= n; i ++ ) { string t , ans ; cin >> t >> ans; if ( t == s ){ vv = 0 ; vvv = 0 ; v ++ ; cout << v << ' ' << ans ; } else if ( t == ss ) { vv ++ ; vvv = 0; cout << v << "." << vv << ' ' << ans ; } else { vvv ++ ; cout << v << '.' << vv << '.' << vvv << ' ' << ans ; } cout << endl ; } 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...