Submission #862679

#TimeUsernameProblemLanguageResultExecution timeMemory
862679MegalosaurusKaučuk (COCI21_kaucuk)C++17
30 / 50
1 ms456 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); signed main() { speed; int q; cin >> q; long double se = 0, sb = 0, sbs = 0; while(q--) { string type, s; cin >> type >> s; if(type == "section") { se++; sb = 0, sbs = 0; cout << se << " " << s << "\n"; } else if(type == "subsection") { sb++; cout << se << "." << sb << " " << s << "\n"; } else { sbs++; cout << se << "." << sb << "." << sbs << " " << s << "\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...