博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
uva 12003 Array Transformer (大规模阵列)
阅读量:4573 次
发布时间:2019-06-08

本文共 777 字,大约阅读时间需要 2 分钟。

白皮书393页面。

乱搞了原始数组中。其实用另一种阵列块记录。

你不能改变原始数组。

请注意,与原来的阵列和阵列块的良好关系,稍微细心处理边境。这是不难。

#include 
#include
#include
#include
#define maxn 300005#define SIZE 600using namespace std;int a[maxn];int block[maxn];int b[maxn];void work(int p,int x){ int old=b[p]; b[p]=x; int BLOCK=p/SIZE; int pos=p; for(int i=BLOCK*SIZE;i
=0 && block[pos-1]==block[p] && a[pos-1]>a[pos]) { swap(a[pos-1],a[pos]); pos--; }}int main(){ int n,m,u; while(scanf("%d%d%d",&n,&m,&u)!=EOF) { memset(a,0x3f,sizeof a); memset(block,0x3f,sizeof block); for(int i=0;i

版权声明:本文博客原创文章,博客,未经同意,不得转载。

转载于:https://www.cnblogs.com/zfyouxi/p/4641341.html

你可能感兴趣的文章
实验四
查看>>
mssql sqlserver 取消数值四舍五入的方法分享
查看>>
[记录] JavaScript 中的事件分类
查看>>
《java JDK7 学习笔记》之接口与多态
查看>>
【NOI2008】志愿者招募
查看>>
LeetCode 96:Unique Binary Search Trees
查看>>
kernel-char设备的建立
查看>>
DVWA-CSRF
查看>>
letecode [404] - Sum of Left Leaves
查看>>
ubuntu common software introduction
查看>>
资源相互引用时 需添加 PerformSubstitution=True
查看>>
MapRedece(单表关联)
查看>>
蒲公英App开发之检测新版本
查看>>
【安卓基础】倒计时按钮封装(验证码倒计时按钮)
查看>>
configparser模块
查看>>
SelectQueryBuilder的用法
查看>>
android的用户定位(一)
查看>>
creat-react-app搭建的项目中按需引入antd以及配置Less和如何修改antd的主题色
查看>>
IIS安装
查看>>
html块级元素和行级元素的区别和使用
查看>>