摘要:
问题 DPL_3_A: Largest Square #include<iostream> #include<algorithm> #include<cstdio> using namespace std; #define MAX 1400 int dp[MAX][MAX], G[MAX][MAX] 阅读全文
摘要:
AOJ-ALDS1_1_D Maximum Profit 本题主要考虑要将复杂度降到O(n),否则过不了最后五组数据 #include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ int n,maxv=-1e1 阅读全文
摘要:
好久没见过CF有这么水的contest了,蒟蒻赶紧找找自信 A. Subtract or Divide #include<iostream> using namespace std; int main(){ int T,n; cin>>T; while(T--) { cin>>n; if(n<=3) 阅读全文
摘要:
GCD,LCM 定理 a、b两个数的最大公约数乘以它们最小公倍数等于a和b的乘积 axb=GCD(a,b)xLCM(a,b) 据此定理,求3与8的最小公倍数可以为:LCM(3,8)=3x8divGCD(3,8)=24 欧几里得算法 构造关系:GCD(a,b)=GCD(b, a mod b) int 阅读全文
摘要:
逆向考虑即可解决 #include<iostream> using namespace std; const int maxn= 100000 +5; int a[maxn][4];//0-x,1-y,2-x-length,3-y-length int main(){ int n,flag=0; c 阅读全文
摘要:
#include<iostream> #include<cstdio> using namespace std; int main(){ int inf = 99999999; int n,m,t1,t2,t3,min; int e[7][7],dis[7],book[7]={0}; int cou 阅读全文
摘要:
#include<iostream> #include<cstdio> using namespace std; struct edge { int u; int v; int w; }; struct edge e[10]; int n,m; int f[7]={0},sum=0,count=0; 阅读全文