USACO代码
chengdazhuo
这个作者很懒,什么都没留下…
展开
-
luogu1203/USACO1.2:Broken Necklace
#include<bits/stdc++.h> using namespace std; char a[3010]; int n,ans,ans1,ans2; int dfs(int x,int p,int i) { int q=p+x;int w; if(p-i==n||i-p==n) { printf("%d\n",n); exit(0); } if(a[p]...原创 2019-08-19 22:01:05 · 127 阅读 · 0 评论 -
luogu2871/USACO:Charm Bracelet
#include<bits/stdc++.h> using namespace std; struct A{int m,v;}a[3550]; int dp[13000]; int main() { int n,V; scanf("%d %d",&n,&V); for(int i=1;i<=n;i++)scanf("%d %d",&a[i].m ,...原创 2019-08-24 10:46:16 · 96 阅读 · 0 评论 -
luogu3009/USACO:Profits
#include<bits/stdc++.h> using namespace std; int a[200010]; int dp[200010]; int ans=-999999999; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d",&a[i]); for(in...原创 2019-08-24 11:06:40 · 88 阅读 · 0 评论 -
luogu2918/USACO:Buying Hay
#include<bits/stdc++.h> using namespace std; struct g{int c,ma;}gr[110]; int dp[1000010]; int main() { int n,m; scanf("%d %d",&n,&m); for(int i=1;i<=n;i++)scanf("%d %d",&gr[i]....原创 2019-08-24 11:36:05 · 117 阅读 · 0 评论 -
luogu2722/USACO3.1:Score Inflaction
#include<bits/stdc++.h> using namespace std; int dp[1000010]; int main() { int m,n; scanf("%d %d",&n,&m); for(int i=1;i<=m;i++) { int x,t; scanf("%d %d",&t,&x); fo...原创 2019-08-24 12:19:05 · 312 阅读 · 0 评论 -
luogu1474/USACO2.3:Money Systems
#include<bits/stdc++.h> using namespace std; long long dp[10100],a[30]; int main() { int n,m; memset(dp,0,sizeof(dp)); dp[0]=1; scanf("%d %d",&n,&m); for(int i=1;i<=n;i++) { ...原创 2019-08-20 22:13:58 · 128 阅读 · 0 评论 -
luogu2701/USACO5.3:Big Barn
#include<bits/stdc++.h> using namespace std; int a[1010][1010]; int dp[1010][1010]; int h[1010][1010]; int d[1010][1010]; int minn(int p,int q,int r) { p=min(p,q); p=min(p,r); return p; } in...原创 2019-08-20 22:24:30 · 89 阅读 · 0 评论 -
luogu2725/USACO3.1:Stamps
#include<bits/stdc++.h> using namespace std; struct dp{bool p;int mi;}a[10000010]; int b[100010]; int maxx=0; int main() { int N,K; scanf("%d %d",&K,&N); for(int i=1;i<=N;i++) { ...原创 2019-08-21 21:35:25 · 122 阅读 · 0 评论 -
luogu2858/USACO:Treats for the Cows
#include<bits/stdc++.h> using namespace std; int a[2010]; int dp[2010][2010]; int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%d",&a[i]); for(int i=1;i<=n;i++...原创 2019-08-23 10:40:02 · 169 阅读 · 0 评论