답안 #1098935

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1098935 2024-10-10T10:49:56 Z ohad Boarding Passes (BOI22_passes) C++14
0 / 100
2 ms 568 KB
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <stdio.h>
using namespace std;
typedef long long ll;

int main() {
	string a;
	cin >> a;

	ll size = a.length();
	double best = size*(size-1)/4;
	for (int i = 0; i < size; i++)
	{

			long double x = ((size-i) * (size -i-1)) / double(4);
			long double y = (i*(i-1)) / double(4);
			y += x;
			if (y + 0.0000001 < best)
				best = y;
	}
	cout << fixed << setprecision(6) << best;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 0 ms 348 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 0 ms 348 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Correct 0 ms 348 KB found '1.0000000000', expected '1.0000000000', error '0.0000000000'
5 Correct 0 ms 348 KB found '124002.0000000000', expected '124002.0000000000', error '0.0000000000'
6 Incorrect 2 ms 568 KB 1st numbers differ - expected: '772893586.0000000000', found: '-276172925.5000000000', error = '1.3573233502'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB 1st numbers differ - expected: '1.0000000000', found: '3.0000000000', error = '2.0000000000'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB found '100800.5000000000', expected '100800.5000000000', error '0.0000000000'
2 Correct 0 ms 348 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
3 Correct 0 ms 348 KB found '0.0000000000', expected '0.0000000000', error '-0.0000000000'
4 Correct 0 ms 348 KB found '1.0000000000', expected '1.0000000000', error '0.0000000000'
5 Correct 0 ms 348 KB found '124002.0000000000', expected '124002.0000000000', error '0.0000000000'
6 Incorrect 2 ms 568 KB 1st numbers differ - expected: '772893586.0000000000', found: '-276172925.5000000000', error = '1.3573233502'
7 Halted 0 ms 0 KB -