Submission #499450

# Submission time Handle Problem Language Result Execution time Memory
499450 2021-12-28T12:42:59 Z adam Kaučuk (COCI21_kaucuk) C++14
50 / 50
1 ms 208 KB
#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
    string s,d;
    int n,x=0,y=0,z=0;
    cin>>n;
    for (int i=1;i<=n;i++)
    {
        cin>>s>>d;
        if (s=="section")
        {
            x++;
            y=0;
            z=0;
        }
        else if (s=="subsection")
        {
            y++;
            z=0;
        }
        else
        {
            z++;
        }
        if (z>0)
        {
            cout<<x<<'.'<<y<<'.'<<z<<' '<<d<<endl;;
        }
        else if (y>0)
        {
             cout<<x<<'.'<<y<<' '<<d<<endl;
        }
        else
        {
             cout<<x<<' '<<d<<endl;
        }
    }
 
 
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 208 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 0 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct