Submission #797864

#TimeUsernameProblemLanguageResultExecution timeMemory
797864tlnk07Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms304 KiB
#include<bits/stdc++.h> using namespace std; long long n, cnt0 = 0, cnt1 = 0, cnt2 = 0; string s, t; int main() { cin >> n; while(n--) { cin >> s >> t; if(s == "section") { ++cnt0; cnt1 = cnt2 = 0; cout << cnt0 << " " << t << "\n"; } else if(s == "subsection") { ++cnt1; cnt2 = 0; cout << cnt0 << "." << cnt1 << " " << t << "\n"; } else { ++cnt2; cout << cnt0 << "." << cnt1 << "." << cnt2 << " " << t << "\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...