Submission #1022117

#TimeUsernameProblemLanguageResultExecution timeMemory
1022117vjudge1Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms436 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int s=0,s1=0,s2=0; for (int i=0;i<n;i++) { string o,t; cin>>o>>t; if (o=="section") { cout<<++s<<' '<<t<<endl; s1=s2=0; } else if(o=="subsection") { cout<<s<<'.'<<++s1<<' '<<t<<endl; s2=0; } else cout<<s<<'.'<<s1<<'.'<<++s2<<' '<<t<<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...