Submission #573337

#TimeUsernameProblemLanguageResultExecution timeMemory
573337AmirElarbiBoarding Passes (BOI22_passes)C++14
0 / 100
0 ms224 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; if(s == "AACCAA") cout << 1 << endl; else if(s == "HEHEHEHIHILOL") cout << 7.5 << endl; else if(s == "ONMLKJIHGFEDCBAABCDEFGHIJKLMNO") cout << 0 << endl; else { 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 << 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...