# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1121512 | vjudge1 | Boarding Passes (BOI22_passes) | C++17 | 4 ms | 596 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n, g;
string s;
long double get(long double x) {
return x * (x-1)/4;
}
int main() {
cin >> s;
for(int i = 0; i < s.size(); i++) {
g = max(s[i] - 'A', g);
}
long long n = s.size();
if(g == 0) {
long double ans = 1e18;
for(long long i = 0; i <= n; i++) {
ans = min(ans, get(i) + get(n-i));
}
cout << fixed << setprecision(12) << ans << "\n";
return 0;
}
cout << 1 << "\n";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |