Submission #601779

#TimeUsernameProblemLanguageResultExecution timeMemory
601779CSQ31Boarding Passes (BOI22_passes)C++17
5 / 100
3 ms596 KiB
//consider scc graph
//u -> v
//if u bad then v must be bad
//so every ingoing edge into v must be good and sum of sub(tree?graph?) must be >= minimal parent
//i dont even need scc,only scc is if all values are equal okay yes
#include <bits/stdc++.h>
using namespace std;
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define pb push_back
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long int ll;
typedef long double ld;
int main()
{
	string s;
	cin>>s;
	int n = sz(s);
	ld ans = 0;
	ll a = (n+1)/2;
	ll b = n/2;
	ans = a*(a-1)/2 + b*(b-1)/2;
	ans/=2;
	cout<<fixed<<setprecision(10)<<ans<<'\n';
	
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...