Submission #521468

#TimeUsernameProblemLanguageResultExecution timeMemory
521468errorgornKaučuk (COCI21_kaucuk)C++17
50 / 50
1 ms320 KiB
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ii pair<ll,ll>
#define fi first
#define se second
#define endl '\n'

#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define ub upper_bound
#define lb lower_bound

#define rep(x,s,e) for (auto x=(s)-((s)>(e));x!=(e)-((s)>(e));(s)<(e)?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()

mt19937 rng(177013);

int main(){
	cin.tie(0);
	cout.tie(0);
	cin.sync_with_stdio(false);
	
	int n;
	cin>>n;
	
	int a=0,b=0,c=0;
	rep(x,0,n){
		string s,t;
		cin>>s>>t;
		
		if (s=="section"){
			a++,b=c=0;
			
			cout<<a<<" "<<t<<endl;
		}
		else if (s=="subsection"){
			b++,c=0;
			
			cout<<a<<"."<<b<<" "<<t<<endl;
		}
		else{
			c++;
			
			cout<<a<<"."<<b<<"."<<c<<" "<<t<<endl;
		}
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...