提交记录 12936


用户 题目 状态 得分 用时 内存 语言 代码长度
panyf noip18a. 【NOIP2018】铺设道路 Runtime Error 0 6.26 us 12 KB C++11 993 B
提交时间 评测时间
2020-07-05 21:02:53 2020-08-01 03:01:47
#include<cstdio>
#include<cstring>
#include<sys/mman.h>

int hash_max=240000,hash_step;
struct _hash
{
	int v[240000];
	void clear(){memset(v,0,sizeof v);}
	int insert(int x)
	{
		int y=x%hash_max;
		for(;v[y]&&v[y]!=x;y+=hash_step,y>=hash_max?y-=hash_max:0);
		if(v[y]==x)return -1;v[y]=x;return y;
	}
	int find(int x)
	{
		int y=x%hash_max;
		for(;v[y]!=x;y+=hash_step,y>=hash_max?y-=hash_max:0);
		return y;
	}
}pp;

int fa[240000];

inline int find(int x)
{
	while(fa[x]>=0&&fa[fa[x]]>=0)x=fa[x]=fa[fa[x]];return fa[x]<0?x:fa[x];
}

inline void merge(int x,int y)
{
	x=find(x),y=find(y);
	if(x!=y){if(fa[x]<fa[y])fa[y]=x;else{if(fa[x]==fa[y])fa[y]--;fa[x]=y;}}
}

int q[100000][2],qm;
char *I;int _x;
int _(){_x=0;while(*I<48)*I++;while(*I>=48)_x=_x*10+*I++-'0';return _x;}

inline bool isp(int n)
{
	for(int i=2;i*i<=n;i++)if(n%i==0)return 0;
	return 1;
}

int main()
{
	
	I=(char*)mmap(NULL,30000000,PROT_READ,MAP_PRIVATE,fileno(stdin),0);
	int t,n,a,b,e,tmp;t=_();
    printf("%d",t);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #14.85 us12 KBRuntime ErrorScore: 0

Testcase #26.19 us12 KBRuntime ErrorScore: 0

Testcase #36.26 us12 KBRuntime ErrorScore: 0

Testcase #45.67 us12 KBRuntime ErrorScore: 0

Testcase #55.78 us12 KBRuntime ErrorScore: 0

Testcase #65.41 us12 KBRuntime ErrorScore: 0

Testcase #75 us12 KBRuntime ErrorScore: 0

Testcase #85.24 us12 KBRuntime ErrorScore: 0

Testcase #94.76 us12 KBRuntime ErrorScore: 0

Testcase #105.02 us12 KBRuntime ErrorScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-25 05:07:18 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠