Cycles of Lanes

LeRobot X-VLA:首个适用于任意机器人、任意任务的软提示机器人基础模型 X-VLA是一种基于软提示的视觉-语言-动作模型,通过可学习嵌入向量编码不同机器人配置,实现跨平台统一控制。该框架采用两阶段训练:先在29万次多平台任务中学习通用策略,再通过微调少量参数(仅1%)适配新机器人。实验表明,0.9B参数的X-VLA在6个仿真和3个真实平台上表现优异,如LIBERO任务达93%成功率,布料折叠任务100%完成。其核心创新是将硬件差异视为"任务",用软提示引导Transformer处理异构数据,为机器人基础模型提供可扩展方案。 阅读详情

滴答滴答---题目链接 

Cycles of Lanes

Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 1809 Accepted: 663

Description

Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by more than one lane and it is possible to pass from each crossroad to each other crossroad by a path composed of one or more lanes. A cycle of lanes is simple when passes through each of its crossroads exactly once.
The administration of the University would like to put on the lanes pictures of the winners of Regional Collegiate Programming Contest in such way that the pictures of winners from the same university to be on the lanes of a same simple cycle. That is why the administration would like to assign the longest simple cycles of lanes to most successful universities. The problem is to find the longest cycles? Fortunately, it happens that each lane of the park is participating in no more than one simple cycle (see the Figure).
 

Input

On the first line of the input file the number T of the test cases will be given. Each test case starts with a line with the positive integers N and M, separated by interval (4 <= N <= 4444). Each of the next M lines of the test case contains the labels of one of the pairs of crossroads connected by a lane.

Output

For each of the test cases, on a single line of the output, print the length of a maximal simple cycle.

Sample Input

1 
7 8 
3 4 
1 4 
1 3 
7 1 
2 7 
7 5 
5 6 
6 2

Sample Output

4

Source

Southeastern European Regional Programming Contest 2009

#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
using namespace std;

const int maxn=10010;
vector<int> v[maxn];
bool vis[maxn];
int ans;
int step[maxn];//记录搜索到某顶点时已搜索过的顶点数
void dfs( int x, int t)
{
    vis[x]=1;
    step[x]=t;//搜索到x时,已搜索过的顶点数
    for(size_t i=0; i<v[x].size(); i++)
    {
        if(!vis[v[x][i]])//没有发现环
            dfs(v[x][i],t+1);
        else//发现环
            ans=max(ans,step[v[x][i]]-step[x]+1);
    }
}

int main()
{

    int n,m,t;
    scanf("%d",&t);
    while(t--)
    {
        scanf("%d%d",&n,&m);
        for(int i=1; i<=n; i++)
        {
            v[i].clear();
        }
        memset(vis,0,sizeof(vis));
        memset(step,0,sizeof(step));
        ans=0;
        while(m--)
        {
            int l,r;
            scanf("%d%d",&l,&r);
            v[l].push_back(r);
            v[r].push_back(l);
        }
        for(int i=1; i<=n; i++)
        {
            if(!vis[i])
                dfs(i,1);
        }
        printf("%d\n",ans);

    }
    return 0;
}

 

Orange3实战教程:转换---预处理 部件提供了多种预处理方法,这些方法可以在单个预处理流程中组合使用。某些方法也可作为独立部件提供,支持更高级的技术和参数调整。连接到测试与评分:在交叉验证的每个批次中应用预处理器,随后学习器的预处理器会作用于预处理后的子集。连接到学习器:覆盖学习器的默认预处理流程,仅应用自定义流程(各学习器的默认步骤详见其文档)。直接连接到原始数据并输出预处理后的数据集,可能导致模型过拟合。:从原始数据中随机选择固定数量或百分比的特征,主要用于高级测试或教学用途。的预处理器输入,同时传入数据和学习器(如。 阅读详情

相关推荐

Xilinx ERNIC RoCEv2 FPGA实现与QP队列深度解析

本文深入解析Xilinx ERNIC RoCEv2在FPGA上的实现,重点剖析QP队列对的管理机制与深度优化策略。通过Verilog代码示例和工程实战,详细介绍了如何实现高吞吐量、低延迟的RDMA硬件卸载方案,为金融交易和数据中心应用提供性能优化指导。

solidity8miner的博客 878

Longest Simple Cycle

题目大意 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; long long c[N], a[N], b[N]; int main(){ int t; cin >> t; while (t --){ int n, k; cin >> n; for (int i

a_4199的博客 232

MuJoCo 机械臂关节空间阻抗控制Impedance实现(附代码)

阻抗控制通过调整关节的刚度和阻尼,让机器人在接触时产生顺应性,减少冲击力,其核心目标是在接触外部载荷时能够自适应调整输出力矩,实现力与位置的协同控制。阻抗控制可以很快的到达设定位置,在此基础上,使用mujoco交互中的施加外力操作,可以看到当外力松开后,机械臂也可以很快的回弹回设定位置。其中self.Kp和self.Kd为固定刚度和阻尼系数,通过修改刚度和阻尼参数,可以变得更柔顺来应对各种场景。注释掉该行后,直接simulate仿真可以看到机械臂控制位置震荡等情况,接下来引入关节空间阻抗控制的代码。

darcsdn 1276

Codeforces C. Longest Simple Cycle (Round 103 Rated for Div.2)(贪心 / 思维)

传送门 题意: 现有 n 条链,第 i 条链的头结点连接第 i-1 条链的第 a[i] 号点,其尾结点连接第 i-1 条链的第 b[i] 号点;先让你找出最大的环的边数。 思路: 从前往后扫一遍,求一个答案的最大值就好。 如果当前链被下一条链连接的是同一个结点,那么表示环到当前位置必须结束了,且开始下一个环,更新中间答案 tmp == 0。 扫描的过程中也要考虑在当前(每一条)链结束会不会答案更大的情况。 同样还要注意,如果以当前链为环的起点会不会比前面的起点答案更大。 具体细节都注释在代码中。

Satur9的博客 249

车规级非易失存储选型指南:从AEC-Q100到ISO 26262的可靠性设计

非易失存储器是电子系统中负责长期保存关键数据与代码的核心组件,其可靠性直接决定了系统的长期稳定运行能力。在汽车电子领域,这一要求被提升到了极致,必须满足严苛的车规级标准。从原理上看,存储器的数据保持能力、擦写寿命等关键参数在高温、振动等恶劣环境下会急剧衰减,因此需要专门的设计与验证。其技术价值在于保障车辆全生命周期的功能安全与数据完整性,避免因存储失效导致的安全隐患或频繁维护。应用场景涵盖从发动机控制单元、自动驾驶域控制器到智能座舱的各类电子控制单元。本文聚焦于车规级非易失存储的选型,深入解析AEC-Q10

weixin_30938149的博客 458

Zemax单模光纤耦合仿真避坑指南:数值孔径、模式匹配与镀膜影响详解

本文详细解析了Zemax单模光纤耦合仿真中的关键避坑要点,包括数值孔径的多重定义与换算、模式匹配度评估及镀膜影响分析。通过实际案例和技术公式,帮助工程师避免常见仿真误差,提升激光通信和光纤传感系统的设计精度。特别针对OpticStudio用户提供了实用的参数设置建议和优化策略。

weixin_30836759的博客 466

POJ 3895 Cycles of Lanes(DFS)

Cycles of Lanes Time Limit:1000MS Memory Limit:65536K Total Submissions:1062 Accepted:392 Description Each of the M lanes of the Park of Polytechnic Uni...

weixin_30872499的博客 153

HC-SR04测距不准?STM32F103定时器捕获模式详解与精度提升实战

本文详细解析了HC-SR04超声波测距模块在STM32F103上的精度问题,并提供了定时器输入捕获模式的实战配置方法。通过硬件级时间测量和温度补偿算法,将测距精度提升至±0.1cm,适用于工业级应用场景。文章包含完整的代码实现和测试对比数据,帮助开发者解决超声波测距不准的常见问题。

weixin_30313409的博客 351

POJ 3895 Cycles of Lanes

  Cycles of Lanes Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1374   Accepted: 502   Description Each of the M lanes of the Park of Polytechnic University of Bucha...

ShawnyXiao的博客 739

Android 蓝牙——概述(一)

Profiles (蓝牙应用规范),它从应用场景的角度为蓝牙技术的使用制定了不同的规范。这也是和大众日常生活接触最多的一部分。蓝牙支持很多Profiles:MAP:(MessageAccessProfile),短信访问协议,允许设备间的信息交换,短信。使用场景:智能车载中同步短信等信息。HFP:(Hands-free Profile),电话免提协议,让蓝牙设备(如蓝牙耳机/车机)可以控制电话,如接听、挂断、拒接等。

小旭的专栏 3492

在Open3D中从网格中采样点云

在本文中,我们将学习如何使用Open3D从网格中采样点云。点云采样是点云处理的重要步骤之一,能够为后续的任务提供必要的输入。通过这些示例代码,我们可以很容易地使用Open3D库从网格模型中采样点云。值得注意的是,根据实际应用需求,我们可以调整采样点的数量和采样方法来满足不同的场景需求。除了使用Poisson Disk算法,Open3D还提供了其他的点云采样方法,如Uniform采样和Random采样。这个函数使用了Poisson Disk采样算法,可以在保持点云均匀性的同时,尽可能避免重叠点的生成。

FxRuby的博客 413

poj3895 Cycles of Lanes

题意:给一个图找最大环的长度 简单dfs 一个点在一个环里只会出现一次 先假设一个点为可能存在的一个环的起点 然后沿起点往下走 每个点标记一个到起点的距离 如果环存在 就可以一直下去找到 vis[a]-vis[x]+1 就是该点a到起点x的距离  存下这个距离ans 接着换一个起点找环 以此类推 如果环不存在 那么ans值一定 #include #include #inclu

Unknown 857

软件设计师---程序设计语言

软件设计师---程序设计语言

我从不打没有准备的仗! 2万+

POJ3895 Cycles of Lanes,DFS

很简单的搜索题,DFS和BFS都可以。 /******************************************************************************* # Author : Neo Fung # Email : neosfung@gmail.com # Last modified: 2012-06-13 16:07 # Fil

Neo Fung的专栏 1210

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

POJ 3895 Cycles of Lanes(dfs+模拟)

Each of the M lanes of the Park of Polytechnic University of Bucharest connects two of the N crossroads of the park (labeled from 1 to N). There is no pair of crossroads connected by more than one lane and it is possible to pass from each crossroad to each

HJY 433

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

poj3895Cycles of Lanes(dfs)

Cycles of Lanes Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 930   Accepted: 347 Description Each of the M lanes of the Park of Polytechnic University o

ophunter的专栏 979

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

poj 3895.Cycles of Lanes

Cycles of Lanes #include #include #include using namespace std; #define N 5000 vector v[N]; int vis[N]; int step[N]; int ans; void dfs(int x,int t) { vis[x]=1; step[x]=t

da_fan_shu_的专栏 311
上一篇: 夜深人静写代码
下一篇: 饭卡(01背包)
chen_zan_yu_
博客等级 码龄8年 569粉丝 1403原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值