摘要:
就是背包01问题 #include<iostream> #include<cstring> /*01背包问题*/ using namespace std; const int maxn = 120; const int maxm = 1e5 + 10; int dp[maxm],a[maxm]; i 阅读全文
posted @ 2024-05-31 15:34
海&贼
阅读(11)
评论(0)
推荐(0)
摘要:
简单问题: 就只是如何降低时间的问题罢了:本来这种方法以前学过但是没怎么用所以不太灵活、 #include<stdio.h> #define maxn 1000010 int sum[maxn]={0}; void Sum(){ for(int i=1;i<=maxn;i++){ for(int j 阅读全文
posted @ 2024-05-31 13:38
海&贼
阅读(16)
评论(0)
推荐(0)
摘要:
就这样 #include<cmath> #include<cstdio> #include<iostream> using namespace std; int main(){ int i,k,sum; while(~scanf("%d",&k)){ i=0,sum=0; k=abs(k); //前 阅读全文
posted @ 2024-05-31 13:30
海&贼
阅读(19)
评论(0)
推荐(0)

浙公网安备 33010602011771号