Submission #1022118

#TimeUsernameProblemLanguageResultExecution timeMemory
1022118vjudge1Kaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms412 KiB
#include<iostream> using namespace std; int main() { int n; cin >> n; int cnt[3] = {}; for(int i = 0; i < n; i ++) { string s, t; cin >> s >> t; if(s == "section") { cnt[0]++, cnt[1] = cnt[2] = 0; cout << cnt[0] << ' ' << t; } else if(s == "subsection") { cnt[1]++, cnt[2] = 0; cout << cnt[0] << '.' << cnt[1] << ' ' << t; } else { cnt[2]++; cout << cnt[0] << '.' << cnt[1] << '.' << cnt[2] << ' ' << t; } cout << endl; } 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...