#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,x=0,c=0,d=0,u;
string s[5000000];
cin>>n;
u=n+1;
for(int i=0;i<n;i++)
{
cin>>s[i]>>s[u];
if(s[i]=="section")
{
x++;
c=0;
d=0;
cout<<x<<" "<<s[u]<<endl;
}
else if(s[i]=="subsection")
{
c++;
d=0;
cout<<x<<"."<<c<<" "<<s[u]<<endl;
}
else if(s[i]=="subsubsection")
{
d++;
cout<<x<<"."<<c<<"."<<d<<" "<<s[u]<<endl;
}
u++;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
85 ms |
156740 KB |
Output is correct |
2 |
Correct |
87 ms |
156824 KB |
Output is correct |
3 |
Correct |
84 ms |
156752 KB |
Output is correct |
4 |
Correct |
85 ms |
156784 KB |
Output is correct |
5 |
Correct |
86 ms |
156800 KB |
Output is correct |
6 |
Correct |
85 ms |
156740 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
82 ms |
156816 KB |
Output is correct |
2 |
Correct |
86 ms |
156788 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
82 ms |
156816 KB |
Output is correct |
2 |
Correct |
86 ms |
156788 KB |
Output is correct |
3 |
Correct |
87 ms |
156704 KB |
Output is correct |
4 |
Correct |
89 ms |
156764 KB |
Output is correct |
5 |
Correct |
85 ms |
156824 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
85 ms |
156740 KB |
Output is correct |
2 |
Correct |
87 ms |
156824 KB |
Output is correct |
3 |
Correct |
84 ms |
156752 KB |
Output is correct |
4 |
Correct |
85 ms |
156784 KB |
Output is correct |
5 |
Correct |
86 ms |
156800 KB |
Output is correct |
6 |
Correct |
85 ms |
156740 KB |
Output is correct |
7 |
Correct |
82 ms |
156816 KB |
Output is correct |
8 |
Correct |
86 ms |
156788 KB |
Output is correct |
9 |
Correct |
87 ms |
156704 KB |
Output is correct |
10 |
Correct |
89 ms |
156764 KB |
Output is correct |
11 |
Correct |
85 ms |
156824 KB |
Output is correct |
12 |
Correct |
85 ms |
156764 KB |
Output is correct |
13 |
Correct |
84 ms |
156832 KB |
Output is correct |
14 |
Correct |
88 ms |
156896 KB |
Output is correct |
15 |
Correct |
82 ms |
156784 KB |
Output is correct |
16 |
Correct |
84 ms |
156748 KB |
Output is correct |
17 |
Correct |
84 ms |
156712 KB |
Output is correct |
18 |
Correct |
84 ms |
156800 KB |
Output is correct |