Submission #744641

#TimeUsernameProblemLanguageResultExecution timeMemory
744641MohamedAhmed04Kaučuk (COCI21_kaucuk)C++14
50 / 50
1 ms332 KiB
#include <bits/stdc++.h> using namespace std ; const int MAX = 1e5 + 10 ; int arr[MAX] ; int n ; int main() { ios_base::sync_with_stdio(0) ; cin.tie(0) ; cin>>n ; int cnt1 = 0 , cnt2 = 0 , cnt3 = 0 ; for(int i = 0 ; i < n ; ++i) { string s1 , s2 ; cin>>s1>>s2 ; if(s1 == "section") { ++cnt1 , cnt2 = cnt3 = 0 ; cout<<cnt1<<" " ; } else if(s1 == "subsection") { ++cnt2 , cnt3 = 0 ; cout<<cnt1<<"."<<cnt2<<" " ; } else if(s1 == "subsubsection") { ++cnt3 ; cout<<cnt1<<"."<<cnt2<<"."<<cnt3<<" " ; } cout<<s2<<"\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...