USCAO section Mother's Milk(搜索)

USACO section 3.4 Closed Fences(计算几何+叉积+二分) Closed Fences A closed fence in the plane is a set of non-crossing, connected line segments with N corners (3 i, yi}, i in (1..N). Every pair of adjacent vertices defines a side of the fence. 阅读详情
Mother's Milk

Farmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C is full of milk. Sometimes, FJ pours milk from one bucket to another until the second bucket is filled or the first bucket is empty. Once begun, a pour must be completed, of course. Being thrifty, no milk may be tossed out.

Write a program to help FJ determine what amounts of milk he can leave in bucket C when he begins with three buckets as above, pours milk among the buckets for a while, and then notes that bucket A is empty.

PROGRAM NAME: milk3

INPUT FORMAT

A single line with the three integers A, B, and C.

SAMPLE INPUT (file milk3.in)

8 9 10

OUTPUT FORMAT

A single line with a sorted list of all the possible amounts of milk that can be in bucket C when bucket A is empty.

SAMPLE OUTPUT (file milk3.out)

1 2 8 9 10

SAMPLE INPUT (file milk3.in)

2 5 10

SAMPLE OUTPUT (file milk3.out)

5 6 7 8 9 10


 

个人深搜解:这样编程需要很认真,否则容易出错,我也是调了挺久的

 

/*
ID:nealgav1
PROG:milk3
LANG:C++
*/
#include<fstream>
#include<cstring>
using namespace std;
int a,b,c;
bool s[22][22][22];
bool flag[23];
void dfs(int aa,int bb,int cc)
{
  if(s[aa][bb][cc])return;
  s[aa][bb][cc]=1;
  int x;
  if(aa==0)
  {
    flag[cc]=1;
    if(aa+cc<=a){x=cc;aa+=x;cc-=x;dfs(aa,bb,cc);aa-=x;cc+=x;}//c->a
    else {x=a-aa;cc-=x;aa+=x;dfs(aa,bb,cc);cc+=x;aa-=x;}
    if(aa+bb<=a){x=bb;bb-=x;aa+=x;dfs(aa,bb,cc);bb+=x;aa-=x;}//b->a
    else {x=a-aa;bb-=x;aa+=x;dfs(aa,bb,cc);bb+=x;aa-=x;}
    if(bb+cc<=c){x=bb;bb-=x;cc+=x;dfs(aa,bb,cc);cc-=x;bb+=x;}//b->c
    else{x=(c-cc);cc+=x;bb-=x;dfs(aa,bb,cc);bb+=x;cc-=x;}
    if(bb+cc<=b){x=cc;cc-=x;bb+=x;dfs(aa,bb,cc);cc+=x;bb-=x;}//c->b
    else{x=(b-bb);bb+=x;cc-=x;dfs(aa,bb,cc);bb-=x;cc+=x;}
  }
  else
  {
    if(aa+bb<=b){x=aa;bb+=x;aa-=x;dfs(aa,bb,cc);bb-=x;aa+=x;}//a->b
    else{x=(b-bb);aa-=x;bb+=x;dfs(aa,bb,cc);bb-=x;aa+=x;}
    if(aa+cc<=c){x=aa;cc+=x;aa-=x;dfs(aa,bb,cc);cc-=x;aa+=x;}//a->c
    else{x=(c-cc);aa-=x;cc+=x;dfs(aa,bb,cc);cc-=x;aa+=x;}
    if(aa+cc<=a){x=cc;aa+=x;cc-=x;dfs(aa,bb,cc);aa-=x;cc+=x;}//c->a
    else {x=a-aa;cc-=x;aa+=x;dfs(aa,bb,cc);cc+=x;aa-=x;}
    if(aa+bb<=a){x=bb;bb-=x;aa+=x;dfs(aa,bb,cc);bb+=x;aa-=x;}//b->a
    else {x=a-aa;bb-=x;aa+=x;dfs(aa,bb,cc);bb+=x;aa-=x;}
    if(bb+cc<=c){x=bb;bb-=x;cc+=x;dfs(aa,bb,cc);cc-=x;bb+=x;}//b->c
    else{x=(c-cc);cc+=x;bb-=x;dfs(aa,bb,cc);bb+=x;cc-=x;}
    if(bb+cc<=b){x=cc;cc-=x;bb+=x;dfs(aa,bb,cc);cc+=x;bb-=x;}//c->b
    else{x=(b-bb);bb+=x;cc-=x;dfs(aa,bb,cc);bb-=x;cc+=x;}
  }
}
int main()
{  int aa,bb,cc;
ifstream fin("milk3.in");
ofstream fout("milk3.out");
  while(fin>>a>>b>>c)
  {
    memset(flag,0,sizeof(flag));
    memset(s,0,sizeof(s));
        dfs(0,0,c);
        int ans=0;
        for(int i=0;i<21;i++)
        if(flag[i])
        ans=i;
        for(int i=0;i<21;i++)
        if(flag[i]&&ans!=i)
        fout<<i<<" ";
        fout<<ans<<"\n";
  }
}


 

以下摘自独孤的博客,感觉着个方法代码敲的少,不易错

还是个搜索题,每次最多无非有6种倒法,即a->b;a->c;b->a;b->c;c->a;c->b。所以如果用a、b、c代表三个桶的容积,x、y、z代表当前三个桶内的牛奶数,那么不难算出执行完a->b后,x变为max(0,x+y-b),y变为min(b,x+y),z不变。其它倒法类似。

最后注意判重最好的方法就是用bool数组flag[i][j][k]表示a、b、c桶分别装i、j、k升牛奶这种状态是否曾经搜到过。但由于牛奶总数不变,故知道了i和j,其实k也就知道了,所以用二维bool数组flag[i][j]就够了。

源码如下:

 

#include <fstream>

using namespace std;

int a,b,c;
bool flag[21][21],can[21];

void dfs(int,int,int);

int main() {
ifstream fin ("milk3.in");
ofstream fout ("milk3.out");
fin >> a >> b >> c;
dfs(0,0,c);
for (int i=0;i<c;i++) if (can[i]) fout << i << ' ';
fout << c << endl;
fin.close();
fout.close();
return 0;
}

void dfs(int x,int y,int z) {
if (flag[x][y]) return;
flag[x][y]=true;
if (x==0) can[z]=true;
if (x>0 && y<b) dfs(max(0,x+y-b),min(b,x+y),z);
if (x>0 && z<c) dfs(max(0,x+z-c),y,min(c,x+z));
if (y>0 && x<a) dfs(min(a,y+x),max(0,y+x-a),z);
if (y>0 && z<c) dfs(x,max(0,y+z-c),min(c,y+z));
if (z>0 && x<a) dfs(min(a,z+x),y,max(0,z+x-a));
if (z>0 && y<b) dfs(x,min(b,z+y),max(0,z+y-b));
}

 

 

 

 

USER: Neal Gavin Gavin [nealgav1]
TASK: milk3
LANG: C++

Compiling...
Compile: OK

Executing...
   Test 1: TEST OK [0.011 secs, 3348 KB]
   Test 2: TEST OK [0.000 secs, 3348 KB]
   Test 3: TEST OK [0.000 secs, 3348 KB]
   Test 4: TEST OK [0.000 secs, 3348 KB]
   Test 5: TEST OK [0.000 secs, 3348 KB]
   Test 6: TEST OK [0.000 secs, 3348 KB]
   Test 7: TEST OK [0.000 secs, 3348 KB]
   Test 8: TEST OK [0.000 secs, 3348 KB]
   Test 9: TEST OK [0.000 secs, 3348 KB]
   Test 10: TEST OK [0.000 secs, 3348 KB]

All tests OK.

Your program ('milk3') produced all correct answers! This is your submission #2 for this problem. Congratulations!

Here are the test data inputs:

------- test 1 ----
2 5 10
------- test 2 ----
20 20 20
------- test 3 ----
5 11 15
------- test 4 ----
2 12 20
------- test 5 ----
19 4 11
------- test 6 ----
5 11 13
------- test 7 ----
3 20 20
------- test 8 ----
7 16 20
------- test 9 ----
20 10 9
------- test 10 ----
7 12 18
Keep up the good work!

 

Mother's Milk
Russ Cox

We use a simple depth-first search to find all the possible states for the three buckets, pruning the search by not researching from states we've seen before.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <ctype.h>

#define MAX 20

typedef struct State	State;
struct State {
    int a[3];
};

int seen[MAX+1][MAX+1][MAX+1];
int canget[MAX+1];

State
state(int a, int b, int c)
{
    State s;

    s.a[0] = a;
    s.a[1] = b;
    s.a[2] = c;
    return s;
}

int cap[3];

/* pour from bucket "from" to bucket "to" */
State
pour(State s, int from, int to)
{
    int amt;

    amt = s.a[from];
    if(s.a[to]+amt > cap[to])
	amt = cap[to] - s.a[to];

    s.a[from] -= amt;
    s.a[to] += amt;
    return s;
}

void
search(State s)
{
    int i, j;

    if(seen[s.a[0]][s.a[1]][s.a[2]])
	return;

    seen[s.a[0]][s.a[1]][s.a[2]] = 1;

    if(s.a[0] == 0)	/* bucket A empty */
	canget[s.a[2]] = 1;

    for(i=0; i<3; i++)
    for(j=0; j<3; j++)
	search(pour(s, i, j));	
}

void
main(void)
{
    int i;
    FILE *fin, *fout;
    char *sep;

    fin = fopen("milk3.in", "r");
    fout = fopen("milk3.out", "w");
    assert(fin != NULL && fout != NULL);

    fscanf(fin, "%d %d %d", &cap[0], &cap[1], &cap[2]);

    search(state(0, 0, cap[2]));

    sep = "";
    for(i=0; i<=cap[2]; i++) {
	if(canget[i]) {
	    fprintf(fout, "%s%d", sep, i);
	    sep = " ";
	}
    }
    fprintf(fout, "\n");

    exit(0);
}

Ran Pang from Canada sends this non-recursive DP solution:

#include<stdio.h>

int m[21][21][21];
int poss[21];
int A, B, C;

int main(void) {
    int i,j,k;
    int flag;
    FILE* in=fopen("milk3.in","r");
    fscanf(in, "%d %d %d",&A, &B, &C);
    fclose(in);
    for(i=0;i<21;i++)
        for(j=0;j<21;j++)
            for(k=0;k<21;k++)
                m[i][j][k]=0;
    for(i=0;i<21;i++)
        poss[i]=0;
    m[0][0][C]=1;

    for(flag=1;flag;) {
        flag=0;
        for(i=0;i<=A;i++)
            for(j=0;j<=B;j++)
                for(k=0;k<=C;k++) {
                    if(m[i][j][k]) {
                	if(i==0) poss[k]=1;
		        if(i) {
	                    if(j<B) {
                                if(B-j>=i) {
                            	    if( m[0][j+i][k]==0) {
                                        m[0][j+i][k]=1;
                                	flag=1;
                            	    }
                                } else {
                            	    if( m[i-(B-j)][B][k] == 0) {
                                        m[i-(B-j)][B][k] =1;
                                        flag=1;
                                    }
                                }
                            }
                            if(k<C) {
                                if(C-k>=i) {
                                    if( m[0][j][k+i]==0) {
                                        m[0][j][k+i]=1;
                                        flag=1;
                                    }
                                }
                                else {
                                    if( m[i-(C-k)][j][C] == 0) {
                                        m[i-(C-k)][j][C] =1;
                                        flag=1;
                                    }
                                }
                            }
                        }
                        if(j) {
                            if(i<A) {
                                if(A-i>=j) {
                                    if( m[i+j][0][k]==0) {
                                        m[i+j][0][k]=1;
                                        flag=1;
                                    }
                                } else {
                                    if( m[A][j-(A-i)][k] == 0) {
                                        m[A][j-(A-i)][k] =1;
                                        flag=1;
                                    }
                                }
                            }
                            if(k<C) {
                                if(C-k>=j) {
                                    if( m[i][0][k+j]==0) {
                                        m[i][0][k+j]=1;
                                        flag=1;
                                    }
                                } else {
                                    if( m[i][j-(C-k)][C] == 0) {
                                        m[i][j-(C-k)][C] =1;
                                        flag=1;
                                    }
                                }
                            }
                        }
                        if(k) {
                            if(i<A) {
                                if(A-i>=k) {
                                    if( m[i+k][j][0]==0) {
                                        m[i+k][j][0]=1;
                                        flag=1;
                                    }
                                } else {
                                    if( m[A][j][k-(A-i)] == 0) {
                                        m[A][j][k-(A-i)] =1;
                                        flag=1;
                                    }
                                }
                            }
                            if(j<B) {
                                if(B-j>=k) {
                                    if( m[i][j+k][0]==0) {
                                        m[i][j+k][0]=1;
                                        flag=1;
                                    }
                                } else {
                                    if( m[i][B][k-(B-j)] == 0) {
                                        m[i][B][k-(B-j)] =1;
                                        flag=1;
                                    }
                                }
                            }
                        }
            }                   
        }
    }
    {
        FILE* out=fopen("milk3.out", "w");
        for(i=0;i<21;i++) {
            if(poss[i]) {
                fprintf(out,"%d",i);
                i++;
                break;
            }
        }
        for(;i<21;i++) {
            if(poss[i]) {
                fprintf(out, " %d", i);
            }
        }
        fprintf(out,"\n");
    }
    return 0;
}

Daniel Jasper from Germany writes:

Both other solutions (recursive and non-recursive) use a 3D-array to store the states, so that the memory usage is O(N3). However a 2D Array and O(N2) would be enough since a state is uniquely defined by the amount of milk in bucket B and C. The amount of milk in bucket A is size-of-C minus amount-in-C minus amount-in-B. This solution works with it, and is a little bit shorter (though not more elegant):

#include <stdio.h>
int A, B, C;
int CB[21][21]; // All states

void readFile() {
    FILE *f;
    f = fopen("milk3.in", "r");
    fscanf(f, "%d%d%d", &A, &B, &C);
    fclose(f);
}

void writeFile() {
    FILE *f; int i;
    f = fopen("milk3.out", "w");
    for(i = 0; i <= C; i++) {
        if(CB[i][C - i] == 1) {
            if((i != C-B) && (i != 0)) fprintf(f, " ");
            fprintf(f, "%d", i);
        }
    }
    fprintf(f, "\n");
    fclose(f);
}

// do brute-force search, c/b: current state
void search(int c, int b) {
    int a;
    if(CB[c][b] == 1) return; // already searched
    CB[c][b] = 1;
    a = C-b-c; // calc amount in A
    // do all moves:
    // c->b
    if(B < c+b) search(c - (B - b), B);
    else search(0, c + b);
    // b->c
    if(C < c+b) search(C, b - (C - c));
    else search(c + b, 0);
    // c->a
    if(A < c+a) search(c - (A - a), b);
    else search(0, b);
    // a->c
    if(C < c+a) search(C, b);
    else search(c + a, b);
    // b->a
    if(A < b+a) search(c, b - (A - a));
    else search(c, 0);
    // a->b
    if(B < b+a) search(c, B);
    else search(c, b + a);
   }
   
int main () {
    readFile();
    search(C, 0);
    writeFile();
    return 0;
}

 

 

基于PLC的冲压件自动生产线电气系统设计【附数据】 考虑到生产线的高效运行和维护简便性,选择了三菱FX系列的可编程逻辑控制器(PLC)作为核心控制单元,该型号的PLC因其高可靠性和强大的功能集,在工业自动化领域有着广泛的应用。最后,在完成初步的软件开发后,进行了多轮次的模拟测试和现场调试,逐步修正了存在的问题,最终达到了预期的功能要求。例如,对于进料环节,选用了光电传感器以精确检测物料的位置;此外,为了适应不同尺寸的工件加工需求,还特别设计了一套可调节的夹具系统,不仅提高了生产线的灵活性,同时也降低了更换模具的成本。✅ 感恩科研路上每一位志同道合的伙伴! 阅读详情

相关推荐

元数据管理:DataHub和OpenMetadata对比分析

DataHub和OpenMetadata都试图解决数据编目,搜索,发现,治理和质量方面的相同问题。这两种工具都是出于为需要支持大量数据源、团队和用例的大型组织解决这些问题而诞生的。尽管这些工具在发布历史和成熟度方面略有不同,但它们的功能存在显着重叠。

weixin_38030820的博客 6651

【USACO】Mother's Milk(搜索)

一开始还在想去重的问题,结果发现后台数据貌似没有重复的情况= = /* ID: 18906421 LANG: C++ PROG: milk3 */ #include #include #include #include using namespace std; const int maxn = 25; int vis[maxn][maxn][maxn] = {0}; vectorans; int

花月阁 863

SRS(简单实时视频服务) 笔记(5)- 视频录制

在SRS使用中实现视频录制功能。

irainsa的博客 1702

uscao Mother's Milk

bfs吧,我做过一题非常可乐跟这题很像。就是每次把牛奶在两个杯子中互倒,找到所有情况把a==0这个情况下的c保存起来(可能不同状态下的c相同用vis标记)。 /* ID: jinbo wu LANG: C++ TASK: milk3 */ #include using namespace std; bool v[25][25][25]; bool vis[25]; struct

silence401的博客 362

系统设计---算法与架构

这片文章对系统设计的具体步骤及相关知识进行介绍,主要分为四部分:算法设计、IC系统架构设计、基于systemC的IC系统设计、系统设计工具SPW简介。 (一)算法设计 系统设计的第一步是给出清晰的系统规范,该规范写明了系统的功能、性能、费用、开发时间等。接下来创建一个系统行为模型,并且可以用来初步验证设计的性能。再下来,对行为模型进行细化,即进行算法设计。算法设计大致分为三步: 1)给出浮点

正在努力的ICer的博客 4380

YOLOv11 网络结构详解:一文看懂 Backbone、Head、C3k2、SPPF 和 Detect 检测头

在使用 YOLOv11 进行目标检测时,我们经常会接触到或这样的模型配置文件。backbone和head分别是什么意思?ConvC3k2SPPFC2PSA这些模块分别起什么作用?P3/8、P4/16、P5/32 代表什么?为什么最后 Detect 要同时接收 3 个不同尺度的特征图?YOLOv11n、YOLOv11s、YOLOv11m、YOLOv11l、YOLOv11x 的区别在哪里?

learnerYC的博客 1879

[USACO1.4]母亲的牛奶 Mother's Milk 搜索

题目 Farmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty while bucket C...

戒毒戒赌戒网瘾,学习学问学做人——好好学习 676

Jenkins+docker 微服务实现自动化部署安装和部署过程

本文详细介绍了如何使用Docker部署Jenkins自动化服务器。主要内容包括:1)拉取Jenkins官方或BlueOcean镜像;2)创建容器并配置端口映射、数据卷挂载;3)设置防火墙规则;4)配置清华大学镜像加速;5)安装必要插件;6)SSH密钥配置;7)构建触发器设置;8)编写自动化构建脚本。通过Docker部署Jenkins可以简化安装流程,确保环境一致性,并利用容器特性实现快速启动和管理。文章提供了完整的配置步骤和注意事项,帮助用户快速搭建CI/CD环境。

qq_33665793的博客 1705

USCAO-Section 1.4 Mother's Milk

原题: Mother’s MilkFarmer John has three milking buckets of capacity A, B, and C liters. Each of the numbers A, B, and C is an integer from 1 through 20, inclusive. Initially, buckets A and B are empty

qq_34407173的博客 355

Latex里面关于作者名字显示有灰色; 二级+三级标题斜体;

Latex里面关于 作者名字显示有灰色; 二级+三级标题斜体,与正文的距离; 邮箱字体;ORCID字体设置(整理不易,请先关注,Thanks)

m0_61015717的博客 755

家用智能监控摄像机如何使用NAS进行存储/备份(小米智能摄像机如何解决群晖 / 飞牛 NAS 识别失败、文件目录不显示问题)

小米摄像头NAS存储总出问题?🤯 别慌!本文揭秘NAS底层逻辑,群晖、飞牛实战指南。手把手教你排查解决所有难题,轻松搞定监控录像安全备份!🔒

XiaoqiangClub的博客 2784

USACO section 3.1 Contact(AC自动机)

Contact IOI'98 The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwave pulsing emission sent right f

nealgavin的专栏 9384

SAP Build Work Zone standard edition 订阅报错 OIDC trust missing 的成因与完整解决路径

摘要:用户订阅SAP Build Work Zone时遇到422错误,提示未配置OpenID Connect信任。该错误表明业务用户需通过SAP Cloud Identity Services的OIDC协议认证,而当前子账户仅配置了SAML信任或未配置信任。解决方法是进入子账户的Trust Configuration页面,使用Establish Trust功能建立与SAP Cloud Identity Services的OIDC信任关系。这是SAP新版服务的强制要求,SAML协议已不被支持。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 212

USCAO section 1.3 Calf Flac

Calf Flac It is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes

nealgavin的专栏 6656

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

USACO section 1.5 Checker Challenge(dfs深搜)

Checker ChallengeExamine the 6x6 checkerboard below and note that the six checkers are arranged on the board so that one and only one is placed in each row and each column, and there is never more tha

nealgavin的专栏 1924

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

USACO section 2.3 Longest Prefix(dp)

Longest Prefix IOI'96 The structure of some biological objects is represented by the sequence of their constituents, where each part is denote by an uppercase letter. Biologists are interested in

nealgavin的专栏 1487

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

USACO section 2.4 Cow Tours(并查集+最短路)

Cow Tours Farmer John has a number of pastures on his farm. Cow paths connect some pastures with certain other pastures, forming a field. But, at the present time, you can find at least two pasture

nealgavin的专栏 1406

USACO section3.1 Shaping Regions(漂浮法)

Shaping Regions N opaque rectangles (1 <= N <= 1000) of various colors are placed on a white sheet of paper whose size is A wide by B long. The rectangles are put with their sides parallel to the s

nealgavin的专栏 1052

USACO section 2.2 Runaround Numbers

Runaround Numbers Runaround numbers are integers with unique digits, none of which is zero (e.g., 81362) that also have an interesting property, exemplified by this demonstration: If you start

nealgavin的专栏 991

USACO section 3.1 Stamps(dp)

Stamps Given a set of N stamp values (e.g., {1 cent, 3 cents}) and an upper limit K to the number of stamps that can fit on an envelope, calculate the largest unbroken list of postages from 1 cent

nealgavin的专栏 980

USCAO section 4.1 Fence Loops(最短路,最小环,5级)

Fence Loops The fences that surround Farmer Brown's collection of pastures have gotten out of control. They are made up of straight segments from 1 through 200 feet long that join together only a

nealgavin的专栏 941

USACO section 1.5 Superprime Rib(深搜)

Superprime RibButchering Farmer John's cows always yields the best prime rib. You can tell prime ribs by looking at the digits lovingly stamped across them, one by one, by FJ and the USDA. Farmer John

nealgavin的专栏 938

USACO section 2.2 Party Lamps

Party Lamps IOI 98 To brighten up the gala dinner of the IOI'98 we have a set of N (10 <= N <= 100) colored lamps numbered from 1 to N. The lamps are connected to four buttons: Button 1: Wh

nealgavin的专栏 914

USACO section 3.2 Spinning Wheels(模拟)

Spinning Wheels 1998 ACM NE Regionals Each of five opaque spinning wheels has one or more wedges cut out of its edges. These wedges must be aligned quickly and correctly. Each wheel also has an ali

nealgavin的专栏 875

USACO section 3.2 Feed Ratios(高斯定理)

Feed Ratios 1998 ACM Finals, Dan Adkins Farmer John feeds his cows only the finest mixture of cow food, which has three components: Barley, Oats, and Wheat. While he knows the precise mixture of th

nealgavin的专栏 803
上一篇: hdu 1010 Tempter of the Bone(DFS+剪枝优化)
下一篇: hdu 2795 Billboard(线段树)
剑不飞
博客等级 码龄15年 86粉丝 505原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址