E. Restoring the Permutation

本文介绍了如何利用并查集路径压缩技术解决E. Restoring the Permutation问题。解法包括最小字典序和最大字典序两种情况。在最大字典序的实现中,通过压缩路径找到每个位置的正确值,并创建辅助数组记录每个数的使用状态及其后续最大字典序的数。
摘要由CSDN通过智能技术生成

Problem - E - Codeforces

搬运巨佬的超牛解法E. Restoring the Permutation - PdrEam - 博客园

具体就是如果要倒序从某一数字开始访问顺序数组未被访问到的节点,使用并查集路径压缩的思想,将一连串不断指向前一个数的路径压缩成一步。

题目的具体解法:

1. 最小字典序:对于q[i]中第一个出现的数,即p[]中确定的数,在输出不确定数的位置时,对于所有并未被确定的数从小到大输出

2. 最大字典序,通过压缩路径,p[i] = find(q[i]);

#include<iostream>
#include<cstring>
#include<cstdio>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<string>
#include<bitset>
#include<cmath>
#include<array>
#include<atomic>
#include<sstream>

//#define int ll
#define pb push_back
#defin
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
翻译This SiO2 shell is a key component in the mechanism for reversible actuation, as illustrated by finite element analysis (FEA) in Fig. 1C. An increase in temperature transforms the SMA (nitinol) from the martensitic to the austenitic phase, causing the 3D structure to flatten into a 2D shape. The responses of the SMA elements at the joints act as driving forces to deform the PI skeleton. This process also elastically deforms the SiO2 shell, resulting in a counter force that limits the magnitude of the deformation. The change in shape ceases when the forces from the shell balance those from the joints (right frame in Fig. 1C). Upon a reduction in temperature, the SMA changes from the austenitic back to the martensitic phase, thereby reducing the force produced by the SMA at the joints to zero. The elastic forces associated with the shell then push the entire system back to the original 3D geometry (left frame in Fig. 1C). Figure S3A simulates the moments generated by the SMA and the SiO2 shell. In the FEA model, the SiO2 shell appears on both the outer and inner surfaces of the 3D robot, consistent with experiments (fig. S3B). Although a single layer of the SiO2 shell at the outer or inner surface can also provide restoring force, the double-layer shell structure follows naturally from the conformal deposition process. This actuation scheme allows for reversible shape transformations using a one-way shape memory material. Without the shell, the structure only supports a single change in shape, from 3D to 2D, as illustrated in fig. S3C. Figure 1D shows optical images of a freestanding 3D peekytoe crab on the edge of a coin, highlighting the preserved 3D geometry enabled by the SiO2 shell after release from the elastomer substrate. Other 3D structures in geometries that resemble baskets, circular helices, and double-floor helices also exhibit high shape storage ratios (>85%) after cycles of heating and cooling (fig. S4). This ratio (s) is defined as s = 1 − |L1 − L0|/L0 × 100%, where L0 and L1 are the distances between the bonding sites at both ends at the initial stage and subsequent stages, respectively
最新发布
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值