#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |