larry*wei 2018-11-11 13:31 采纳率: 0%
浏览 290

二维数组中最大采集和的 c 阶运动

I've been having trouble with a problem, something like this:

I have a 2D array where each position is filled with a certain number samples (represented by ints). There are nanorobots, each going in a straight line through a part of a line of column (each with a pre-specified way), collecting all samples along the way. If a nanorobot collects samples on a position, the position becomes contaminated and if another robot comes there, it gets confused and stops. I can deploy the robots in any order, and each robot starts working only after the previous one has stopped.

With this information, I want to find the order in which the highest number of samples is collected.

Any help with the problem would be appreciated, as I am pretty stumped. I have a general idea of how it's done, but can't seem to move forward. One thing specifically is how do I mark which places a robot has been to so that i know where other robots should stop if they come there, every solution I've come up with seems really slow. Thanks.

转载于:https://stackoverflow.com/questions/53249237/c-order-of-movement-in-a-2d-array-for-maximum-sum-collected

  • 写回答

1条回答

  • 撒拉嘿哟木头 2018-11-11 14:23
    关注

    To help you developing your algorithms, I provide you with a possible data structure:

    typedef struct LIST {
        int sample;
        struct LIST *next;
    } t_list;
    
    typedef struct ITEM {
        t_list *samples;
        int visited;
    } t_item;
    
    t_item items[10][10];
    

    This defines an array of 10x10 items. Each item has a list of samples and an indicator that it has been visited ("contaminated"). A list element (a sample) has the sample value and a pointer to the next list element (the next sample). I hope this helps.

    评论

报告相同问题?

悬赏问题

  • ¥15 Matlab怎么求解含参的二重积分?
  • ¥15 苹果手机突然连不上wifi了?
  • ¥15 cgictest.cgi文件无法访问
  • ¥20 删除和修改功能无法调用
  • ¥15 kafka topic 所有分副本数修改
  • ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
  • ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
  • ¥40 串口调试助手打开串口后,keil5的代码就停止了
  • ¥15 电脑最近经常蓝屏,求大家看看哪的问题
  • ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档