Submission #1098940

#TimeUsernameProblemLanguageResultExecution timeMemory
1098940ohadBoarding Passes (BOI22_passes)C++14
0 / 100
2 ms604 KiB
#include <iostream> #include <vector> #include <cmath> #include <iomanip> #include <stdio.h> using namespace std; typedef long long ll; int main() { string a; cin >> a; long size = a.length(); double best = size*(size-1)/4; for (int i = 0; i < size; i++) { double x = ((size-i) * (size -i-1)) / double(4)+ (i*(i-1)) / double(4); if (x < best) best = x; } cout << fixed << setprecision(6) << best; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...