class Solution {public: int threeSumClosest(vector<int>& nums, int target) { int closest = nums[0] + nums[1] + nums[2]; int diff = abs(clos...
class Solution {public: vector<vector<int> > fourSum(vector<int> &nums, int target) { set<vector<int> > res; sort(nums.begin(), nums.end())...
class Solution {public: vector<vector<int>> threeSum(vector<int>& nums) { set<vector<int>> res; sort(nums.begin(), nums.end()); for...
#include<iostream>using namespace std;int main(){ int n; while(cin>>n){ int sum=0; int i,m; for(i=1;i<=n;++i){ cin...
#include <iostream> using namespace std; int main() { int n,a,sum=0; while(cin>>n&&n!=0) { while (n--) { ci...
#include <iostream> using namespace std; int main() { int n,m,a,sum=0; while(cin>>n) { while (n--) { ci...
#include<iostream> using namespace std; int GetMaxNum(int a[],int n) //求最大字段和 { int i,sum=0,maxsum=0; maxsum|=1<<31; for(i=1;i<=n;i+...
#include <stdio.h> #include <string.h> #define MAXN 120005 int main() { int num[7]; int T = 0; while (scanf("%d %d %d %d %d %d", &num...
#include <iostream> using namespace std; int main() { int a,b,t,i,max; while(cin >> a >> b) { cout << a << " " << b << " "; ......
#include <stdio.h>#include <math.h>int main(void){int t,n,i;double sum;scanf("%d", &t);while(t--){scanf("%d",&n);sum=0;for(i=2;i<=n;i++)...