Submission #722334

# Submission time Handle Problem Language Result Execution time Memory
722334 2023-04-11T18:40:42 Z HamletPetrosyan Boarding Passes (BOI22_passes) C++17
5 / 100
1 ms 468 KB
/// -- -- ---- --- -- --
/// 11.04.2023 Tue 22:40
/// -- -- ---- --- -- --

#include <bits/stdc++.h>
using namespace std;
void abandoned_precalc();

#define pll pair<long long, long long>
#define all(a) (a).begin(), (a).end()
#define len(a) ((long long)(a).size())
#define add push_back
#define mkp make_pair
#define ll long long
#define fr first
#define sc second

const long long INF = 1000000000ll * 1000000003ll;
const long long MOD = 1000000007ll;
const int N = 2e5 + 5;

string s;
ll ans4 = INF;

void solve(){
	cin >> s;
	for(ll i = 0; i <= len(s); i++){
		ans4 = min(ans4, i * (i - 1) + (len(s) - i) * (len(s) - i - 1));
	}
	cout << (double)ans4 / 4. << "\n";
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	int _ = 1;
	cout << fixed;
	cout.precision(9);

	abandoned_precalc();
	// cin >> _ ;
	while(_--) solve();
	return 0;
}

/// ---- - --------  ------ -------- -- - - -
/// just a reminder. ubuntu password is i o i
/// ---- - --------  ------ -------- -- - - -














void abandoned_precalc(){
	
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 1 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 1 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Correct 1 ms 212 KB found '1.0000000000', expected '1.0000000000', error '0.0000000000'
5 Correct 0 ms 212 KB found '124002.0000000000', expected '124002.0000000000', error '0.0000000000'
6 Correct 1 ms 468 KB found '772893586.0000000000', expected '772893586.0000000000', error '0.0000000000'
7 Correct 1 ms 468 KB found '1100977812.5000000000', expected '1100977812.5000000000', error '0.0000000000'
8 Correct 1 ms 468 KB found '1249950000.5000000000', expected '1249950000.5000000000', error '0.0000000000'
9 Correct 1 ms 468 KB found '1249975000.0000000000', expected '1249975000.0000000000', error '0.0000000000'
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 1 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 1 ms 212 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Correct 1 ms 212 KB found '1.0000000000', expected '1.0000000000', error '0.0000000000'
5 Correct 0 ms 212 KB found '124002.0000000000', expected '124002.0000000000', error '0.0000000000'
6 Correct 1 ms 468 KB found '772893586.0000000000', expected '772893586.0000000000', error '0.0000000000'
7 Correct 1 ms 468 KB found '1100977812.5000000000', expected '1100977812.5000000000', error '0.0000000000'
8 Correct 1 ms 468 KB found '1249950000.5000000000', expected '1249950000.5000000000', error '0.0000000000'
9 Correct 1 ms 468 KB found '1249975000.0000000000', expected '1249975000.0000000000', error '0.0000000000'
10 Incorrect 1 ms 212 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
11 Halted 0 ms 0 KB -