Submission #499427

# Submission time Handle Problem Language Result Execution time Memory
499427 2021-12-28T11:47:37 Z adam Kaučuk (COCI21_kaucuk) C++14
20 / 50
1 ms 204 KB
#include <iostream>

using namespace std;

int main()
{
   int n;
   cin>>n;
   string a[n],b[n];
   double l[n];
   double temp=0,temp1=0,temp2=0;
   for(int i=0;i<n;i++)
   {
       cin>>a[i]>>b[i];
       if(a[i]=="section"){l[i]=temp+1;temp++;}
       if(a[i]=="subsection"){l[i]=temp+((temp1+1)/10);temp1++;}
       if(a[i]=="subsubsection"){l[i]=temp+(temp1/10);temp2++;}
   }
   for(int i=0;i<n;i++)
   {
       if(a[i]!="subsubsection")
        cout<<l[i]<<' '<<b[i]<<endl;
        else cout<<l[i]<<'.'<<temp2<<' '<<b[i]<<endl;

   }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 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 1 ms 204 KB Output is correct
3 Incorrect 0 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Incorrect 0 ms 204 KB Output isn't correct
10 Halted 0 ms 0 KB -