Submission #577332

#TimeUsernameProblemLanguageResultExecution timeMemory
577332AlexandruabcdeKaučuk (COCI21_kaucuk)C++14
50 / 50
1 ms304 KiB
#include <bits/stdc++.h> using namespace std; int main () { int N; cin >> N; int cnt[3]; cnt[0] = cnt[1] = cnt[2] = 0; for (int i = 1; i <= N; ++ i ) { string what; cin >> what; if (what == "section") { cnt[0] ++; cnt[1] = 0, cnt[2] = 0; } else if (what == "subsection") { cnt[1] ++; cnt[2] = 0; } else ++ cnt[2]; string name; cin >> name; if (what == "section") { cout << cnt[0] << " " << name << '\n'; continue; } if (what == "subsection") { cout << cnt[0] << "." << cnt[1] << " " << name << '\n'; continue; } if (what == "subsubsection") { cout << cnt[0] << "." << cnt[1] << "." << cnt[2] << " " << name << '\n'; continue; } } 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...