Submission #876387

#TimeUsernameProblemLanguageResultExecution timeMemory
876387JoksimKaktusKaučuk (COCI21_kaucuk)C++17
50 / 50
0 ms600 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; void output(bool yes){yes ? cout << "Yes" << "\n" : cout << "No" << "\n";} int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); int n; cin >> n; int s = 0; int ss = 0; int sss = 0; for(int i = 0;i < n;i++){ string a,b; cin >> a >> b; if(a == "section"){ s++; cout << s << " " << b << "\n"; ss = 0; sss = 0; }else if(a == "subsection"){ ss++; cout << s << "." << ss << " " << b << "\n"; sss =0; }else{ sss++; cout << s << "." << ss << "." << sss << " " << b << "\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...