Submission #1266266

#TimeUsernameProblemLanguageResultExecution timeMemory
1266266canhnam357Kaučuk (COCI21_kaucuk)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int f = 1, s = 1, g = 1; int n; cin >> n; while (n--) { string a, b; cin >> a >> b; if (a == "section") { s = 1; cout << f++ << ' ' << b << '\n'; } else if (a == "subsection") { g = 1; cout << f - 1 << "." << s++ << ' ' << b << '\n'; } else { cout << f - 1 << "." << s - 1 << "." << g++ << ' ' << 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...