Submission #573333

#TimeUsernameProblemLanguageResultExecution timeMemory
573333AmirElarbiBoarding Passes (BOI22_passes)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #define vi vector<int> #define ve vector #define ll long long #define vf vector<float> #define vll vector<pair<ll,ll>> #define ii pair<int,int> #define vvi vector<vi> #define vii vector<ii> #define gii greater<ii> #define pb push_back #define mp make_pair #define fi first #define se second #define INF 1e9+7 #define eps 1e-7 #define eps1 1e-2 #define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define MAX_A 2e5+5 using namespace std; const int MOD = 1e4+7; const int nax = 4e5+5; typedef complex<int> Point; #define X real() #define Y imag() int main(){ optimise; string s; cin >> s; int n = s.size(); long double mn = INF; for (int i = 0; i <= n; ++i) { long double nb1 = i, nb2 = n-i; long double cur = nb1*(nb1-1) + nb2*(nb2-1); cur /= 4.; mn = min(mn, cur); } cout << setprecision(1) << fixed << mn; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...