← Back to List

2292번: 벌집 ↗

Solutions

C++14
232 B | 232 chars
#include <iostream>
using namespace std;
int N,S=1,K=1;
int main()
{
    cin>>N;
    while(S<N)
    {
        S+=K*6;
        K++;
        if(S>=N)
        {
            cout<<K;
            return 0;
        }
    }
    cout<<1;
}