一.题目说明 11.Container With Most Water,这个题目难度是Medium. 二.我的做法 乍一看,简单啊,两个for循环就可以了,我在本地写的. #include<iostream> #include<vector> #include<math.h> using namespace std; class Solution{ public: int maxArea(vector<int> &height){ int max =…
1138 连续整数的和 #include <iostream> #include <cmath> #include <cstdio> using namespace std; int main() { int n; while(cin>>n) { int m = (int)sqrt(n); int sum = 0; for(int i=m*2; i>=2; i--) { if( (2*n+i-i*i)%(2*i)==0 && (2*n+…
The blocks in the city of Fishburg are of square form. N avenues running south to north and Mstreets running east to west bound them. A helicopter took off in the most southwestern crossroads and flew along the straight line to the most northeastern…