【MemSQL Start[c]UP 3.0 - Round 1 B】 Lazy Security Guard

【链接】h在这里写链接


【题意】


围成对应面积的方块最少需要多少条边。

【题解】


有特定的公式的。
2*ceil(2*根号下(n));
->
自己找下规律也很简单的。

【错的次数】


0

【反思】


在这了写反思

【代码】

#include <bits/stdc++.h>
using namespace std;

int n;

int main(){
    //freopen("F:\\rush.txt","r",stdin);
    ios::sync_with_stdio(0),cin.tie(0);
    cin >> n;
    cout << 2*ceil(2*sqrt(n)) << endl;
    return 0;
}


posted @ 2017-10-04 18:44  AWCXV  阅读(85)  评论(0编辑  收藏  举报