Submission #987917

#TimeUsernameProblemLanguageResultExecution timeMemory
987917AugustynKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms600 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; #define ssize(a) ((int)(a.size())) int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int nrs = 0, nrss = 0, nrsss = 0; for(int i = 0; i < n; ++i) { string s1, s2; cin >> s1 >> s2; if(s1 == "section") { ++nrs; nrss = 0; nrsss = 0; cout << nrs << " "; } else if(s1 == "subsection") { nrsss = 0; ++nrss; cout<< nrs << "." << nrss << " "; } else { ++nrsss; cout<< nrs << "." << nrss << "." << nrsss << " "; } cout << s2 << "\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...