Submission #862535

#TimeUsernameProblemLanguageResultExecution timeMemory
862535Cyber_WolfKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms348 KiB
// Problem: E - Sequence Decomposing // Contest: AtCoder - AtCoder Beginner Contest 134 // URL: https://atcoder.jp/contests/abc134/tasks/abc134_e // Memory Limit: 1024 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <bits/stdc++.h> using namespace std; #define lg long long int main() { lg n; cin >> n; lg lev = 0; vector<lg> a(3); while(n--) { string s, t; cin >> s >> t; if(s == "section") { while(lev) { a[lev] = 0; lev--; } a[lev]++; cout << a[lev] << ' ' << t << '\n'; } else if(s == "subsection") { while(lev > 1) { a[lev] = 0; lev--; } lev = 1; a[lev]++; cout << a[0] << '.' << a[1] << ' ' << t << '\n'; } else{ lev = 2; a[2]++; cout << a[0] << '.' << a[1] << '.' << a[2] << ' ' << 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...