This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define endl "\n"
#define int long long
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
void solve(){
int n;
cin >> n;
int c1=0,c2=0,c3=0;
for(int i=1;i<=n;i++){
string s1,s2;
cin >> s1 >> s2;
if(s1=="section"){
c1++;
c3=c2=0;
cout << c1 << " " << s2 << endl;
}
else if(s1=="subsection"){
c2++;
c3=0;
cout << c1 << '.' << c2 << " " << s2 << endl;
}
else{
c3++;
cout << c1 << '.' << c2 << '.' << c3 << " " << s2 << endl;
}
}
}
int32_t main(){
cin.tie(0); ios::sync_with_stdio(0);
int t=1;//cin >> t;
while(t--) solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |