diff --git a/froglike6/README.md b/froglike6/README.md index 1bde718..d979d30 100644 --- a/froglike6/README.md +++ b/froglike6/README.md @@ -9,4 +9,5 @@ | 5차시 | 2025.04.01 | 정수 | [개구리](https://www.acmicpc.net/problem/25333)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/17| | 6차시 | 2025.04.07 | 백트래킹| [N-Queen](https://www.acmicpc.net/problem/9663)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/24| | 7차시 | 2025.04.09 | 그래프 | [최소비용 구하기](https://www.acmicpc.net/problem/1916)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/27| + | 8차시 | 2025.04.11 | 물리학 | [곰곰이와 시소](https://www.acmicpc.net/problem/26072)|https://github.com/AlgoLeadMe/AlgoLeadMe-13/pull/31| --- diff --git a/froglike6/physics/26072.py b/froglike6/physics/26072.py new file mode 100644 index 0000000..1842833 --- /dev/null +++ b/froglike6/physics/26072.py @@ -0,0 +1,12 @@ +import sys +input = sys.stdin.readline +N, L = map(int, input().split()) +x_list = list(map(int, input().split())) +w_list = list(map(int, input().split())) + +total_weight = sum(w_list) +weighted_sum = sum(w * x for x, w in zip(x_list, w_list)) + +pivot = weighted_sum / total_weight + +print(f"{pivot:.10f}") \ No newline at end of file