A - Horizon Editorial by kyopro_friends
プログラミングの学習を始めたばかりで何から手をつけるべきかわからない方は、まずは「practice contest」(https://atcoder.jp/contests/practice/) の問題A「Welcome to AtCoder」をお試しください。言語ごとに解答例が掲載されています。
また、プログラミングコンテストの問題に慣れていない方は、「AtCoder Beginners Selection」(https://atcoder.jp/contests/abs) の問題をいくつか試すことをおすすめします。
「競プロ典型 90 問」(https://atcoder.jp/contests/typical90) では、プログラミングコンテストで扱われる典型的な 90 問の問題に挑戦可能です。
「C++入門 AtCoder Programming Guide for beginners (APG4b)」(https://atcoder.jp/contests/APG4b) は、競技プログラマー向けのC++入門用コンテンツです。
この問題は、入力を整数値として受け取り、問題文に記載されている通りに計算し、答えを出力することで解くことができます。
言語・実装によっては、オーバーフローや出力形式に注意する必要がある場合があります。
実装例(C)
#include<stdio.h>
#include<math.h>
int main(){
double h;
scanf("%lf",&h);
printf("%.9f\n",sqrt(h*(12800000+h)));
}
実装例(Python)
import math
H=int(input())
print(math.sqrt(H*(12800000+H)))
posted:
last update: