Submission #659439

# Submission time Handle Problem Language Result Execution time Memory
659439 2022-11-17T18:19:22 Z Kenpar Kaučuk (COCI21_kaucuk) C++17
50 / 50
1 ms 320 KB
#include "bits/stdc++.h"
using namespace std;

#define ll long long
#define endl '\n'

const ll MOD = 1e9+7;
const ll INF = 1e16;
const ll MAX = 2 * 1e5;

void solve(){
	int n;
	cin>>n;

	int a = 0, b = 0, c = 0;
	for(int i = 0; i < n; i++){
		string x,y; cin>>x>>y;

		if(x == "section"){
			a++;
			b = 0;
			c = 0;
		}else if(x == "subsection"){
			b++;
			c = 0;
		}else{
			c++;
		}

		cout<<a;

		if(b > 0){
			cout<<'.'<<b;

			if(c > 0){
				cout<<'.'<<c;
			}
		}

		cout<<" ";
		cout<<y<<endl;
	}

}


int main()
{
	cin.tie(NULL);
	ios::sync_with_stdio(NULL);
	int t = 1;

	//cin >> t;

	while(t--){
		//cout<<"Case #"<<t<<" > "<<endl;
		solve();

		cout<<endl;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 320 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 316 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 320 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 316 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct