Submission #788950

#TimeUsernameProblemLanguageResultExecution timeMemory
788950OzyBoarding Passes (BOI22_passes)C++17
0 / 100
1 ms332 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; #define lli long long int #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " #define rep(i,a,b) for(int i = (a); i<=(b); i++) #define repa(i,a,b) for(int i = (a); i>=(b); i--) #define pll pair<lli,lli> #define MAX 100000 lli n,k; long double dp[MAX+2],res,a; string st; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> st; n = st.size(); res = -1; rep(i,2,n) { a = (i-1); a/=2; dp[i] = dp[i-1] + a; k = n-i; if (k <= i) { a = dp[k] + dp[i]; if (res < 0 || a < res) res = a; } } cout << res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...