The Preliminary Contest for ICPC Asia Nanjing 2019

【yolo】YOLOv8模型导出完全指南:从PT到ONNX及其他格式的完整实践 摘要:本文全面介绍了YOLOv8模型从PT格式导出为ONNX等部署格式的完整流程与最佳实践。重点解析了关键参数(如format、imgsz、simplify)的作用机制,特别强调输入尺寸imgsz会自动继承训练尺寸的特性,并提供了ONNX、TensorRT等格式的典型导出配置方案。文章还总结了常见问题解决办法,推荐使用simplify优化模型性能,同时分享了通过C#实现模型重命名的实用技巧。最后指出"训练决定能力,导出定义接口"的核心原则,帮助开发者高效完成模型部署转换。 阅读详情

F - Greedy Sequence

You’re given a permutation aa of length n ( 1 ≤ n ≤ 1 0 5 ) . n (1 \le n \le 10^5 ). n(1≤n≤105).

For each i ∈ [ 1 , n ] i \in [1,n] i∈[1,n], construct a sequence s i s_i si​ by the following rules:

  1. s i [ 1 ] = i s_i[1]=i si​[1]=i;
  2. The length of s i s_i si​ is n n n, and for each j ∈ [ 2 , n ] j \in [2, n] j∈[2,n], s i [ j ] ≤ s i [ j − 1 ] s_i[j] \le s_i[j-1] si​[j]≤si​[j−1];
  3. First, we must choose all the possible elements of s i s_i si​ from permutation aa. If the index of s i [ j ] s_i[j] si​[j] in permutation a a a is p o s [ j ] pos[j] pos[j], for each j ≥ 2 j \ge 2 j≥2, ∣ p o s [ j ] − p o s [ j − 1 ] ∣ ≤ k ( 1 ≤ k ≤ 1 0 5 |pos[j]-pos[j-1]|\le k (1 \le k \le 10^5 ∣pos[j]−pos[j−1]∣≤k(1≤k≤105). And for each s i s_i si​ , every element of s i s_i si​ must occur in a at most once.
  4. After we choose all possible elements for s i s_i si​, if the length of s i s_i si​ is smaller than n n n, the value of every undetermined element of s i s_i si​ is 0 0 0;
  5. For each s i s_i si​ , we must make its weight high enough.

Consider two sequences C = [ c 1 , c 2 , . . . c n ] C = [c_1, c_2, ... c_n] C=[c1​,c2​,...cn​] and D = [ d 1 , d 2 , . . . , d n ] D=[d_1, d_2, ..., d_n] D=[d1​,d2​,...,dn​], we say the weight of C C C is higher than that of D D D if and only if there exists an integer k k k such that 1 ≤ k ≤ n , c i = d i 1 \le k \le n, c_i=d_i 1≤k≤n,ci​=di​ for all 1 ≤ i &lt; k 1 \le i &lt; k 1≤i<k and c k &gt; d k c_k &gt; d_k ck​>dk​.

If for each i ∈ [ 1 , n ] i \in [1,n] i∈[1,n], c i = d i c_i=d_i ci​=di​ , the weight of C C C is equal to the weight of D D D.

For each i ∈ [ 1 , n ] i \in [1,n] i∈[1,n], print the number of non-zero elements of s i s_i si​ separated by a space.

It’s guaranteed that there is only one possible answer.

Input
There are multiple test cases.

The first line contains one integer T ( 1 ≤ T ≤ 20 ) T(1 \le T \le 20) T(1≤T≤20), denoting the number of test cases.

Each test case contains two lines, the first line contains two integers nn and k ( 1 ≤ n , k ≤ 1 0 5 ) k (1 \le n,k \le 10^5) k(1≤n,k≤105), the second line contains nn distinct integers a 1 , a 2 , . . . , a n ( 1 ≤ a i ≤ n ) a_1, a_2, ..., a_n (1 \le a_i \le n) a1​,a2​,...,an​(1≤ai​≤n) separated by a space, which is the permutation a a a.

Output
For each test case, print one line consists of nn integers ∣ s 1 ∣ , ∣ s 2 ∣ , . . . , ∣ s n ∣ |s_1|, |s_2|, ..., |s_n| ∣s1​∣,∣s2​∣,...,∣sn​∣ separated by a space.

∣ s i ∣ |s_i| ∣si​∣ is the number of non-zero elements of sequence s i s_i si​.

There is no space at the end of the line.

样例输入

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

样例输出

1 2 3
1 1 2 3 2 3 3

有的人用的是主席树,我看好多暴力都过了,我也暴力

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5+7;
int s[MAXN];
int pos[MAXN];
int main() {
        // freopen("../in.txt","r",stdin);
        // freopen("../out.txt","w",stdout);
        int t,n,x,k;
        scanf("%d",&t);
        while(t--) {
                scanf("%d %d",&n,&k);
                for(int i=0;i<n;++i) {
                        cin>>x;
                        pos[x] = i;
                }
                for(int i=1;i<=n;++i)   s[i] = 1;
                for(int i=1;i<=n;++i)
                        for(int j=i-1;j>0;--j)
                                if(abs(pos[i]-pos[j])<=k) {
                                        s[i] += s[j];
                                        break;
                                }
                for(int i=1;i<=n;++i)
                        printf("%d%c",s[i],i==n?'\n':' ');

        }
        return 0;
}

H - Holy Grail

As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to participate in the cruel Holy Grail War which has a reincarnation of sixty years.However,fortunately,you summoned a Caster Servant with a powerful Noble Phantasm.When your servant launch her Noble Phantasm,it will construct a magic field,which is actually a directed graph consisting of n vertices and m edges.More specifically,the graph satisfies the following restrictions :

  • Does not have multiple edges(for each pair of vertices x and y, there is at most one edge between this pair of vertices in the graph) and does not have self-loops(edges connecting the vertex with itself).
  • May have negative-weighted edges.
  • Does not have a negative-weighted loop.
  • n<=300 , m<=500.

Currently,as your servant’s Master,as long as you add extra 6 edges to the graph,you will beat the other 6 masters to win the Holy Grail.

However,you are subject to the following restrictions when you add the edges to the graph:

  • Each time you add an edge whose cost is c,it will cost you c units of Magic Value.Therefore,you need to add an edge which has the lowest weight(it’s probably that you need to add an edge which has a negative weight).
  • Each time you add an edge to the graph,the graph must not have negative loops,otherwise you will be engulfed by the Holy Grail you summon.

Input
Input data contains multiple test cases. The first line of input contains integer t — the number of testcases ( 1 ≤ t ≤ 5 ) (1 \le t \le 5) (1≤t≤5).

For each test case,the first line contains two integers n,m,the number of vertices in the graph, the initial number of edges in the graph.

Then m lines follow, each line contains three integers x, y and w ( 0 ≤ x , y ≤ n , − 1 0 9 ≤ w ≤ 1 0 9 , x ! = y ) (0 \le x,y\le n, -10^9≤w≤10^9, x != y) (0≤x,y≤n,−109≤w≤109,x!=y) denoting an edge from vertices x to y (0-indexed) of weight w.

Then 6 lines follow, each line contains two integers s,t denoting the starting vertex and the ending vertex of the edge you need to add to the graph.

It is guaranteed that there is not an edge starting from s to t before you add any edges and there must exists such an edge which has the lowest weight and satisfies the above restrictions, meaning the solution absolutely exists for each query.

Output
For each test case,output 6 lines.

Each line contains the weight of the edge you add to the graph.

样例输入
1
10 15
4 7 10
7 6 3
5 3 3
1 4 11
0 6 20
9 8 25
3 0 9
1 2 15
9 0 27
5 2 0
7 3 -5
1 7 21
5 0 1
9 3 16
1 8 4
4 1
0 3
6 9
2 1
8 7
0 4
样例输出
-11
-9
-45
-15
17
7

因为有负权,要用SPFA

6次SPFA
每次找到t到s的最短路之后,在图中加一条s到t的负边


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e3+7;
const int INF = 0x3f3f3f3f;
struct node{
        int v,w;
        node(){}
        node(int _v,int _w):v(_v), w(_w){}
};

vector<node> G[MAXN];
int n,m,dis[MAXN];
bool vis[MAXN];
// int cont[MAXN];
int SPFA(int s,int t) {
        memset(dis,0x3f,sizeof(dis));
        memset(vis,0,sizeof(vis));
        // memset(cont,0,sizeof(cont));
        queue<int> Q;
        Q.push(s);
        dis[s] = 0;
        // ++cont[s];
        while(!Q.empty()) {
                int u = Q.front(); Q.pop();
                vis[u] = false;
                for(int i=0;i<(int)G[u].size();++i) {

                        int v = G[u][i].v;
                        int w = G[u][i].w;
                        // cout<<u<<" "<<v<<" "<<w<<endl;
                        if(dis[v]>dis[u]+w) {
                                dis[v] = dis[u] + w;
                                if(!vis[v]) {
                                        Q.push(v);
                                        vis[v] = true;
                                }
				// if(++cont[v] > n)//有负环
				// 	return -1;

                        }
                }
        }
        return dis[t];
}

int main() {
        // freopen("../in.txt","r",stdin);
        // freopen("../out.txt","w",stdout);
        int t;
        scanf("%d",&t);
        while(t--) {
                node e;
                scanf("%d %d",&n,&m);
                for(int i=0;i<=n;++i)   G[i].clear();
                for(int i=0;i<m;++i) {
                        int x,y,z;
                        scanf("%d %d %d",&x,&y,&z);
                        e.v = y;
                        e.w = z;
                        G[x].push_back(e);
                }
                for(int i=0;i<6;++i) {
                        int s,t;
                        scanf("%d %d",&s,&t);
                        int ans = -SPFA(t,s);
                        printf("%d\n",ans);
                        e.v = t;
                        e.w = ans;
                        G[s].push_back(e);
                }
        }
        return 0;
}

业态即战场:零售平台的生意模型与系统设计解构 在这篇文章中,我们从“控货、自营、联营”三种典型零售业态出发,拆解了亚马逊、阿里、京东和本地闪购平台在商品模型设计上的差异与博弈。看似简单的卖货方式背后,其实是平台在“控货权”“商品归属权”上的深层策略博弈:谁掌控商品,谁就掌控数据、流量与利润分配权。本文尝试用一套通俗但不失专业的方式,帮助产品经理和技术伙伴读懂零售平台商品模型的底层逻辑与系统设计演化路径。 阅读详情

相关推荐

AES128加密算法开发(含源码)

本文详解了AES128加密算法的原理与C语言实现。AES128是当前广泛使用的对称加密标准,采用128位密钥和10轮变换,具有高安全性和高效性。文章从算法背景、核心概念(混淆与扩散)入手,详细解析了4×4状态矩阵表示、4个核心变换(字节替换、行移位、列混合、轮密钥加)以及密钥扩展过程。特别针对汽车电子应用场景,如ECU通信加密、车钥匙认证等,说明了AES128在资源受限环境中的优势。通过分步图解和原理剖析,帮助开发者深入理解这一加密标准的技术细节与实现方法。

汽车电子软件开发笔记 2918

The Preliminary Contest for ICPC Asia Nanjing 2019 题解

The Preliminary Contest for ICPC Asia Nanjing 2019 【A. The beautiful values of the palace】 【题目大意】 有一个n * n的矩阵,n为奇数,矩阵中的数字为n * n的正序排列,且顺时针增大,左下角标号(1, 1),右上角标号(n, n) 现在告诉你矩阵中有m个数字被标记,并给出了标记数字的标号,然后给出p个...

weixin_44211980的博客 376

PPL文档——Excel制作的甘特图加上动态今日线

当很多项目需要跟踪进度时,我们介绍一种在Excel中创建甘特图。

qq_34777858的博客 7064

The Preliminary Contest for ICPC Asia Nanjing 2019 F. Greedy Sequence

The Preliminary Contest for ICPC Asia Nanjing 2019 F.Greedy Sequence 题目链接 You’re given a permutation aa of length n(1≤n≤105)n (1 \le n \le 10^5)n(1≤n≤105). For each i∈[1,n]i\in [1,n]i∈[1,n], construct a sequence sis_isi​ by the following rules: si[1]=is

旺崽的博客 2597

手把手教你复现IEEE 2025高光谱图像盲超分算法DBSR(附开源代码与避坑指南)

本文详细介绍了如何从零复现IEEE 2025高光谱图像盲超分算法DBSR,包括环境配置、数据预处理、核心模块解析、训练策略及常见问题解决方案。特别针对开源代码中的关键步骤和潜在问题提供了实用指南,帮助研究者和开发者高效实现Deep blind super-resolution技术,适用于遥感、医疗等领域的图像增强应用。

weixin_42524708的博客 413

用 ABAP CDS View 把数据稳定抽到 SAP BW/4HANA:从 ODP 架构到增量机制的落地实践

本文探讨了SAP数据仓库中从业务系统抽取数据到SAP BW/4HANA的最佳实践,重点分析了基于ABAP CDS视图的抽取方法。文章指出CDS视图通过注解可实现元数据描述、增量机制的统一管理,替代传统抽取器。详细介绍了ODP架构如何作为抽取基础设施,以及从CDS到BW的完整链路。同时比较了三种增量抽取方式(BW管理时间戳、ODP通用增量、CDC触发器)的适用场景和注意事项,并强调版本兼容性和云环境连接差异对实施的影响。通过实际案例说明合理选择增量策略对数据仓库稳定性的重要性。

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

The Preliminary Contest for ICPC Asia Nanjing 2019 E K Sum

The Preliminary Contest for ICPC Asia Nanjing 2019 E题 K Sum 题意:定义 fn(k)=∑l1=1n∑l2=1n…∑lk=1n(gcd(l1,l2,…,lk))2f_n(k)=\sum\limits_{l_1=1}^{n}\sum\limits_{l_2=1}^{n}…\sum\limits_{l_k=1}^{n}(gcd(l_1,l_2,…...

tirion_chenrui的博客 215

EB配置I2c - 实现与PF8200的读写操作

①,基于硬件实现IIC通信(硬件GPIO引脚配置为I2c复用引脚)②,基于软件模拟IO实现IIC通信(代码控制SDA和SCL两个IO引脚的电平来模拟IIC时序)本文章基于64pin的恩智浦S32K146型号的芯片作为主机,从机是NXP的供电芯片。在本次实验中,我们将以使用EB工具链来配置硬件IIC通信。1,EB配置2,代码编写3,测试验证话不多说,走你~写操作比较简单,只需要申明一个I2c配置结构体变量即可。

weixin_48498880的博客 3768

补题 The Preliminary Contest for ICPC Asia Nanjing 2019

B super_log 链接:https://nanti.jisuanke.com/t/41299 题目意思:求a ^a ^a …… ^a (b个a)对m取模的结果。 思路:欧拉降幂。这题一开始想得复杂了,考虑了扩展欧拉降幂,因为取模的m与a可能不互质,后来发现并不需要,直接写就好了。 代码: #include<bits/stdc++.h> using namespace std; t...

xiayuccc的博客 341

【图像去噪】论文复现:降维打击!图像对输入变成像素对输入!Pytorch实现Noise2Void(N2V),基于U-Net模型训练,简洁明了理解N2V核心思想!附训练好的灰度图和RGB图的模型文件!

论文题目:Noise2Void-Learning Denoising from Single Noisy Images —— Noise2Void -从单个噪声图像中学习去噪【图像去噪】论文精读:Noise2Void-Learning Denoising from Single Noisy Images(N2V)由于源码是tensorflow版本,本文将基于Pytorch复现。

主要更新底层视觉(去噪、超分等)相关的科研内容,形式为【论文精读】+【论文复现】 1356

13、基因相似性度量的相关性及特征选择研究

本文研究了基因相似性度量和特征选择在生物学中的应用,详细介绍了GO术语相似性度量的多种方法,包括语义度量和路径长度度量,并分析了不同方法在酵母和人类数据集上的表现。研究发现,Avg-sum方法和基于路径长度的度量在多数情况下效果较好。此外,通过晚期辐射毒性预测的案例研究,探讨了特征选择的重要性及可能面临的过拟合和噪声干扰问题,并提出了相应的解决策略。

js777的博客 127

The Preliminary Contest for ICPC Asia Nanjing 2019 B:super_log

super_log 题意是有个一函数log a*(x) ,x<1时为-1,x>1为1+log a*(log a(x)) 给你a,b,m让求最小使不等式(log a*(x)>=b)成立的最小x%m 这题可以转换为求a的a次方的a次方…b个,模于m。 求幂可以用快速幂,然后必须降幂,因为m不一定是素数,所以这里就要用广义欧拉降幂来降幂了,否则幂就会因为太大而出错。 广义欧拉降幂需要求...

xfx's blog 7531

【100%通过率】2023华为od机试C卷【电脑病毒感染】C语言 实现

一个局域网内有很多台电脑,分别标注为 0 ~ N-1 的数字。相连接的电脑距离不一样,所以感染时间不一样,感染时间用t 表示。其中网络内一台电脑被病毒感染,求其感染网络内所有的电脑最少需要多长时间。如果最后有电脑不会感染,则返回-1.

MISAYAONE的博客 1042

The Preliminary Contest for ICPC Asia Nanjing 2019 A

https://nanti.jisuanke.com/t/41298 #include <bits/stdc++.h> #define MAXN 1000006 #define MAXQ 100005 #define MAXM 100005 #define ask 0 #define add 1 using namespace std; int T,n,m,q; struct p...

吉良吉影的博客 332

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

The Preliminary Contest for ICPC Asia Nanjing 2019 H. Holy Grail

The Preliminary Contest for ICPC Asia Nanjing 2019 H. Holy Grail 题目链接 As the current heir of a wizarding family with a long history,unfortunately, you find yourself forced to participate in the cruel Holy Grail War which has a reincarnation of sixty years

旺崽的博客 2624

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

The Preliminary Contest for ICPC Asia Nanjing 2019 B. super_log

The Preliminary Contest for ICPC Asia Nanjing 2019 B. super_log #include<bits/stdc++.h> using namespace std; typedef long long ll; ll a,b,mod; ll MOD(ll a,ll b){return a<b?a:a%b+b;} ll power(ll a,ll b,ll mod){return b?MOD(power(MOD(a*a,mod),b/2,m

旺崽的博客 2656

The Preliminary Contest for ICPC Asia Nanjing 2019 南京网络赛

H 最短路 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 300 + 5; const ll inf = 1e17; ll d[maxn][maxn]; int main() { int t; scanf("%d", &t); whi...

weixin_40588429的博客 218

The Preliminary Contest for ICPC Asia Nanjing 2019 D Robots

Robots Given a directed graph with no loops which starts at node 11 and ends at node nn. There is a robot who starts at 11, and will go to one of adjacent nodes or stand still with equal probability e...

逝者如斯夫,不舍昼夜 235

The Preliminary Contest for ICPC Asia Nanjing 2019【A B D E F】

题目地址:The Preliminary Contest for ICPC Asia Nanjing 2019 F. Greedy Sequence 题意: 题意有点绕,自己读吧 分析: 首先题目要求字典序最大,假设Sk在A数组的位置是pos,那么Sk的下一个数Sk+1一定是A[pos-k......pos+k]中小于Sk的最大值,类似dp的思想,以Sk开头的序列中不为0的数dp[S...

KobeDuu 748
上一篇: AtCoder Beginner Contest 139
下一篇: 牛客练习赛51 A-E
陶鸿杰
博客等级 码龄9年 93粉丝 298原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值