제출 #714510

#제출 시각아이디문제언어결과실행 시간메모리
714510ibrahim001Boarding Passes (BOI22_passes)C++14
5 / 100
3 ms468 KiB
#include "bits/stdc++.h" #define intt long long #define pb push_back #define endl '\n' #define F first #define S second #define pii pair<int,int> #define pll pair<intt,intt> #define ld long double using namespace std; int i,j; int main(){ string s; cin >> s; int n = s.size(); // int n = 899; // if ( n%2 == 0 ){ // cout << setprecision(9) << fixed << 1.0*n/4*(n/2-1) << endl; // } // else{ // ld a = (n-1)/4.0, b = (n-1)/2.0; // cout << setprecision(9) << fixed << a*b << endl; // } ld res = 0; for ( i = 1; i <= (n+1)/2; i++ ) res += 1.0*(i-1)/2; for ( ; i <= n; i++ ) res += 1.0*(n-i)/2; cout <<setprecision(9) << fixed << res << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...