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

时间:2023-03-09 13:10:00
【MemSQL Start[c]UP 3.0 - Round 1 B】  Lazy Security Guard

【链接】h在这里写链接


【题意】


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

【题解】


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

【错的次数】



【反思】


在这了写反思

【代码】

#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;
}