F. Desktop Rearrangement

在这里插入图片描述
在这里插入图片描述
#题意:给定图像模拟电脑桌面图标移动,给定坐标位置,如果有就删除该图标,然后输出将桌面整理按列排列要多少步,如果没有图标则创建一个新图标再进行移动。
#思路:模拟桌面图标的整理过程将二维的图形转换为按列排列的一维图标再进行模拟操作。

#include<bits/stdc++.h>
using namespace std;
char a[1005][1005],b[1005*1005];
int main()
{
    int n,m,t,cnt=0;cin>>n>>m>>t;
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++){
            cin>>a[i][j];//矩阵中存入图形
            if(a[i][j]=='*') cnt++;//记录初始图标个数
            b[(j-1)*n+i]=a[i][j];//将二维图形按照列转化成一维便于,模拟
        }
    int sum=0;
    for(int i=cnt+1;i<=n*m;i++) if(b[i]=='*') sum++;//记录最开始整理好要多少步
    while(t--){
        int x,y,p;cin>>x>>y;
        p=(y-1)*n+x;//得到操作的点再一维数组里面的位置
        if(b[p]=='*'){//该位置有图标
            b[p]='.';//清除图标
            if(p>cnt) sum--;
            if(p!=cnt&&b[cnt]=='*') sum++;//已经是整理好的位置
            cnt--;
        }
        else{//该位置没有图标
            b[p]='*';//创建图标
            cnt++;
            if(p>cnt) sum++;
            if(p!=cnt&&b[cnt]=='*') sum--;//该位置已经已经移动好
        }
        cout<<sum<<endl;
    }
    return 0;
}
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
润色下面英文:The controlled drug delivery systems, due to their precise control of drug release in spatiotemporal level triggered by specific stimulating factors and advantages such as higher utilization ratio of drug, less side-effects to normal tissues and so forth, provide a new strategy for the precise treatment of many serious diseases, especially tumors. The materials that constitute the controlled drug delivery systems are called “smart materials” and they can respond to the stimuli of some internal (pH, redox, enzymes, etc.) or external (temperature, electrical/magnetic, ultrasonic and optical, etc.) environments. Before and after the response to the specific stimulus, the composition or conformational of smart materials will be changed, damaging the original balance of the delivery systems and releasing the drug from the delivery systems. Amongst them, the photo-controlled drug delivery systems, which display drug release controlled by light, demonstrated extensive potential applications, and received wide attention from researchers. In recent years, photo-controlled drug delivery systems based on different photo-responsive groups have been designed and developed for precise photo-controlled release of drugs. Herein, in this review, we introduced four photo-responsive groups including photocleavage groups, photoisomerization groups, photo-induced rearrangement groups and photocrosslinking groups, and their different photo-responsive mechanisms. Firstly, the photocleavage groups represented by O-nitrobenzyl are able to absorb the energy of the photons, inducing the cleavage of some specific covalent bonds. Secondly, azobenzenes, as a kind of photoisomerization groups, are able to convert reversibly between the apolar trans form and the polar cis form upon different light irradiation. Thirdly, 2-diazo-1,2-naphthoquinone as the representative of the photo-induced rearrangement groups will absorb specific photon energy, carrying out Wolff rearrangement reaction. Finally, coumarin is a promising category photocrosslinking groups that can undergo [2+2] cycloaddition reactions under light irradiation. The research progress of photo-controlled drug delivery systems based on different photo-responsive mechanisms were mainly reviewed. Additionally, the existing problems and the future research perspectives of photo-controlled drug delivery systems were proposed.
02-06

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值