Submission #798359

#TimeUsernameProblemLanguageResultExecution timeMemory
798359Tunglam07Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms340 KiB
#include<bits/stdc++.h> using namespace std; int main() { int n, cnt0 = 0, cnt1 = 0, cnt2 = 0; cin >> n; while(n--) { string s, s1; cin >> s >> s1; if(s == "section") { cnt0++; cnt1 = cnt2 = 0; cout << cnt0 << " " << s1 << endl; } else if(s == "subsection") { cnt1++; cnt2 = 0; cout << cnt0 << "." << cnt1 << " " << s1 << endl; } else { cnt2++; cout << cnt0 << "." << cnt1 << "." << cnt2 << " " << s1 << endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...