Submission #499441

# Submission time Handle Problem Language Result Execution time Memory
499441 2021-12-28T12:22:31 Z adam Kaučuk (COCI21_kaucuk) C++14
10 / 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+1)/100);temp2++;}
   }
   for(int i=0;i<n;i++)
   {
       if(a[i]!="subsubsection")
        cout<<l[i]<<' '<<b[i]<<endl;
        else
        {
            int h=(l[i]*100);
            double u=h%10;
            cout<<l[i]-(u/10)<<'.'<<h<<' '<<b[i];
        }

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