zl程序教程

您现在的位置是:首页 >  其它

当前栏目

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

Security round 3.0 start Up lazy Guard
2023-09-14 09:03:49 时间

【链接】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;
}