Submission #736776

#TimeUsernameProblemLanguageResultExecution timeMemory
736776VadimKKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n,sec=0,sub=0,ss=0; cin>>n; for (int i=1; i<=n; i++) { string s,title; cin>>s>>title; if (s=="section") {sec++; sub=0; ss=0; cout<<sec<<" "<<title<<"\n";} else if (s=="subsection") {sub++; ss=0; cout<<sec<<"."<<sub<<" "<<title<<"\n";} else {ss++; cout<<sec<<"."<<sub<<"."<<ss<<" "<<title<<"\n";} } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...