记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Wrong Answer 3ms 256.0 KiB
#2 Accepted 2ms 328.0 KiB
#3 Accepted 8ms 384.0 KiB
#4 Accepted 11ms 340.0 KiB
#5 Wrong Answer 642ms 308.0 KiB
#6 Wrong Answer 622ms 328.0 KiB
#7 Wrong Answer 662ms 368.0 KiB
#8 Wrong Answer 648ms 324.0 KiB
#9 Wrong Answer 649ms 332.0 KiB
#10 Wrong Answer 612ms 328.0 KiB

代码

#include <iostream>
#include <cstdio>
#include<algorithm>
#define inf 1e9
#define ll long long
#define maxn 401000
#define y1 fuck
#define For(i,j,k) for(ll i=j;i<=k;i++)
#define Dow(i,j,k) for(ll i=k;i>=j;i--)
using namespace std;
inline ll read(){   ll x=0,f=1;char ch=getchar();   while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}  while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}  return x*f; }
inline void write(ll x){    if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10);   putchar(x%10+'0');  }
inline void writeln(ll x){write(x);puts("");}
inline void write_p(ll x){write(x);putchar(' ');}
ll n,k,ans1[40][2],tw[40],x;
inline void doit1()
{
	ll ans=0;
	For(i,1,n)	x=read(),ans^=x;
	writeln(ans);
	exit(0);
}
inline void doit2()
{
	tw[0]=1;
	For(i,1,35)	tw[i]=tw[i-1]*2LL;
	For(i,1,n)
	{
		x=read();
		For(j,0,35)	if(x&(tw[j]))	ans1[j][1]^=x;else ans1[j][0]^=x;
	}
	For(i,1,35)	if(ans1[i][1]!=ans1[i][0]&&ans1[i][1]!=0&&ans1[i][0]!=0)	{writeln(min(ans1[i][1],ans1[i][0])),writeln(max(ans1[i][1],ans1[i][0]));exit(0);}
}
int main()
{
//	freopen("water.in","r",stdin);freopen("water.out","w",stdout);
	n=read();k=read();
	if(k==1)	doit1();
	if(k==2)	doit2();
}

信息

递交者
类型
递交
题目
亚由题
语言
C++
递交时间
2017-08-19 12:20:46
评测时间
2017-08-19 12:20:46
评测机
分数
30
总耗时
3863ms
峰值内存
384.0 KiB