Submission #862680

# Submission time Handle Problem Language Result Execution time Memory
862680 2023-10-18T19:59:24 Z Megalosaurus Kaučuk (COCI21_kaucuk) C++17
50 / 50
1 ms 600 KB
#include <bits/stdc++.h>
	
using namespace std;

#define int long long
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

signed main() 
{
	speed;
	int q;
	cin >> q;
	long double se = 0, sb = 0, sbs = 0;
	while(q--)
	{
		string type, s;
		cin >> type >> s;
		if(type == "section")
		{
			se++;
			sb = 0, sbs = 0;
			cout << se << " " << s << "\n";
		}
		else if(type == "subsection")
		{
			sb++;
			sbs = 0;
			cout << se << "." << sb << " " << s << "\n"; 
		}
		else
		{
			sbs++;
			cout << se << "." << sb << "." << sbs << " " << s << "\n";
		}
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 600 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 600 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 600 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 600 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct