안녕하세요. 오늘은 갈래의 색종이를 자를 거예요.

문제

https://www.acmicpc.net/problem/31472

아이디어

2를 곱하고 루트를 씌워줍시다.
그리고 4를 곱해주면 됩니다.

소스코드

#include <iostream>
#include <cmath>
#define ll long long
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll x;
    cin >> x;
    cout << 4 * sqrt(2 * x);
}


감사합니다.

0개의 댓글