Submission #68338078
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
int main()
{
string t,s;
cin>>t;
double ans=0.00000000,slen=0.000000000,cnt=0.00000000;
int i,j=0,len,flg=0,a;
len=t.size();
for(i=len-1;i>=0;i--){
if(t[j]=='t'){
a=i;
break;
}
}
for(i=0;i<a+1;i++){
if(t[i]=='t'||flg==1){
s[j]=t[i];
flg=1;
j++;
}
}
slen=s.size();
for(i=0;i<slen;i++){
if(t[i]=='t'){
cnt++;
}
}
ans=(cnt*1.0-2.0)/(slen*1.0-2.0)+ans;
cout<<fixed<<setprecision(10)<<ans<<endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - You're a teapot |
| User | yutoman2025 |
| Language | C++ 20 (gcc 12.2) |
| Score | 0 |
| Code Size | 658 Byte |
| Status | RE |
| Exec Time | 77 ms |
| Memory | 3904 KiB |
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:8:25: warning: ‘a’ may be used uninitialized [-Wmaybe-uninitialized]
8 | int i,j=0,len,flg=0,a;
| ^
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 200 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt |
| All | 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 01-20.txt, 01-21.txt, 01-22.txt, 01-23.txt, 01-24.txt, 01-25.txt, 01-26.txt, 01-27.txt, 01-28.txt, 01-29.txt, 01-30.txt, 01-31.txt, 01-32.txt, 01-33.txt, 01-34.txt, 01-35.txt, 01-36.txt, 01-37.txt, 01-38.txt, 01-39.txt, 01-40.txt, 01-41.txt, 01-42.txt, 01-43.txt, 01-44.txt, 01-45.txt, 01-46.txt, 01-47.txt, 01-48.txt, 01-49.txt, 01-50.txt, 01-51.txt, 01-52.txt, 01-53.txt, 01-54.txt, 01-55.txt, 01-56.txt, 01-57.txt, 01-58.txt, 01-59.txt, 01-60.txt, 01-61.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00-sample-01.txt | WA | 1 ms | 3796 KiB |
| 00-sample-02.txt | WA | 1 ms | 3800 KiB |
| 00-sample-03.txt | WA | 1 ms | 3728 KiB |
| 01-01.txt | WA | 1 ms | 3792 KiB |
| 01-02.txt | WA | 1 ms | 3768 KiB |
| 01-03.txt | WA | 1 ms | 3596 KiB |
| 01-04.txt | WA | 1 ms | 3736 KiB |
| 01-05.txt | WA | 1 ms | 3792 KiB |
| 01-06.txt | WA | 1 ms | 3776 KiB |
| 01-07.txt | WA | 1 ms | 3720 KiB |
| 01-08.txt | WA | 1 ms | 3724 KiB |
| 01-09.txt | AC | 1 ms | 3800 KiB |
| 01-10.txt | WA | 1 ms | 3788 KiB |
| 01-11.txt | WA | 1 ms | 3900 KiB |
| 01-12.txt | WA | 1 ms | 3600 KiB |
| 01-13.txt | WA | 1 ms | 3900 KiB |
| 01-14.txt | WA | 1 ms | 3720 KiB |
| 01-15.txt | WA | 1 ms | 3800 KiB |
| 01-16.txt | RE | 76 ms | 3600 KiB |
| 01-17.txt | RE | 75 ms | 3572 KiB |
| 01-18.txt | WA | 1 ms | 3744 KiB |
| 01-19.txt | WA | 1 ms | 3792 KiB |
| 01-20.txt | RE | 76 ms | 3628 KiB |
| 01-21.txt | RE | 75 ms | 3672 KiB |
| 01-22.txt | WA | 1 ms | 3896 KiB |
| 01-23.txt | WA | 1 ms | 3792 KiB |
| 01-24.txt | WA | 1 ms | 3788 KiB |
| 01-25.txt | WA | 1 ms | 3688 KiB |
| 01-26.txt | AC | 1 ms | 3776 KiB |
| 01-27.txt | AC | 1 ms | 3732 KiB |
| 01-28.txt | AC | 1 ms | 3900 KiB |
| 01-29.txt | AC | 1 ms | 3716 KiB |
| 01-30.txt | WA | 1 ms | 3792 KiB |
| 01-31.txt | WA | 1 ms | 3800 KiB |
| 01-32.txt | WA | 1 ms | 3788 KiB |
| 01-33.txt | WA | 1 ms | 3804 KiB |
| 01-34.txt | WA | 1 ms | 3904 KiB |
| 01-35.txt | AC | 1 ms | 3776 KiB |
| 01-36.txt | WA | 1 ms | 3900 KiB |
| 01-37.txt | WA | 1 ms | 3812 KiB |
| 01-38.txt | WA | 1 ms | 3796 KiB |
| 01-39.txt | AC | 1 ms | 3600 KiB |
| 01-40.txt | WA | 1 ms | 3756 KiB |
| 01-41.txt | AC | 1 ms | 3800 KiB |
| 01-42.txt | RE | 77 ms | 3764 KiB |
| 01-43.txt | RE | 75 ms | 3660 KiB |
| 01-44.txt | RE | 75 ms | 3620 KiB |
| 01-45.txt | RE | 76 ms | 3672 KiB |
| 01-46.txt | WA | 1 ms | 3728 KiB |
| 01-47.txt | WA | 1 ms | 3792 KiB |
| 01-48.txt | WA | 1 ms | 3788 KiB |
| 01-49.txt | WA | 1 ms | 3712 KiB |
| 01-50.txt | WA | 1 ms | 3756 KiB |
| 01-51.txt | WA | 1 ms | 3780 KiB |
| 01-52.txt | WA | 1 ms | 3636 KiB |
| 01-53.txt | RE | 76 ms | 3588 KiB |
| 01-54.txt | RE | 76 ms | 3688 KiB |
| 01-55.txt | WA | 1 ms | 3776 KiB |
| 01-56.txt | WA | 1 ms | 3784 KiB |
| 01-57.txt | RE | 75 ms | 3640 KiB |
| 01-58.txt | WA | 1 ms | 3792 KiB |
| 01-59.txt | WA | 1 ms | 3732 KiB |
| 01-60.txt | WA | 1 ms | 3640 KiB |
| 01-61.txt | WA | 1 ms | 3660 KiB |