#include<iostream>
using namespace std;
//head为表头,e[]为存值,ne为next
const int N=1000000;
int head,e[N], ne[N], idx;
void init()
{
head = -1; idx = 0;//head的下标为-1 ,idx准备好下次操作,idx表示当前操作位置
}
void inserthead(int a)
{
e[idx] = a;//赋值操作
ne[idx] = head;//idx->next指向head
head = idx;//head指向idx
idx++;//典中典头插,
}
void insertany(int k, int a)
{
e[idx] = a;
ne[idx] = ne[k];
ne[k] = idx;
idx++;//和上面类似,此处为在k后插入
}
void deletenode(int k)
{
ne[k] = ne[ne[k]];//删除操作,对k后一个进行删除,将next指向next的next
}