摘要:
#include<bits/stdc++.h> //#define test using namespace std; int mapp[1001][1001]; int visited[1001]; int n,m; int nownum; int ava[1001][1001]; int dfs 阅读全文
摘要:
import math import random import matplotlib.pyplot as plt import time limitx=300000 limity=300000 datanum=2000 threshold=datanum*0.01 data=[] datax=[] 阅读全文
摘要:
算法导论提到过,虽然这里面有个循环,但是把循环次数平分一下好像就很小。 class Solution { public: vector<int> countBits(int num) { vector<int> res; int n=0,t; int s=0; int a[10000]; memse 阅读全文
摘要:
算法导论提到过这题 class Solution { public: int longestCommonSubsequence(string text1, string text2) { int a[1001][1001]; int i,j; for(i=0;i<1001;i++){ a[i][0] 阅读全文
摘要:
不难 class Solution { public: int clumsy(int N) { int i; if(N==3) return 6; if(N==2||N==1) return N; int a=N*(N-1)/(N-2)+N-3; N-=4; int sign=1; long lon 阅读全文
摘要:
class Solution { public: int lengthOfLIS(vector<int>& nums) { int i=0,j=0,maxx=0; int k; bool flag=true; int len[10000]; for(i=0;i<nums.size();i++){ l 阅读全文