/ Randle /

记录详情

Wrong Answer

/in/foo.cc: In function 'int find(int, int, int)':
/in/foo.cc:31:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 状态 耗时 内存占用
#1 Accepted 3ms 348.0 KiB
#2 Accepted 3ms 376.0 KiB
#3 Accepted 3ms 372.0 KiB
#4 Accepted 3ms 352.0 KiB
#5 Accepted 3ms 364.0 KiB
#6 Wrong Answer 4ms 364.0 KiB
#7 Wrong Answer 3ms 352.0 KiB
#8 Wrong Answer 12ms 348.0 KiB
#9 Wrong Answer 4ms 376.0 KiB
#10 Wrong Answer 4ms 348.0 KiB

代码

#include<bits/stdc++.h>
#define maxn 100001
using namespace std;
int n,f[1001];
inline const void read(int &a)
{
	a=0;
	int k=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-')
		k=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9')
	{
		a=(a<<1)+(a<<3)+c-'0';
		c=getchar();
	}
	a*=k;
}
int find(int x,int l,int r)
{
	if(l==r)
	return l;
	int mid=(l+r)/2;
	if(f[mid]>x)
	find(x,l,mid);
	else find(x,mid+1,r);
}
int main()
{
	//freopen("sort.in.txt","r",stdin);
	//freopen("sort.out.txt","w",stdout);
	read(n);
	int ai;
	for(int i=1;i<=n;i++)
	{
	    read(ai);
	    if(f[f[0]]<=ai)
	    f[++f[0]]=ai;
	    else f[find(ai,1,f[0])]=ai;
	}
	cout<<f[0]<<endl;
	return 0;
}

信息

递交者
类型
递交
题目
序 T2
题目数据
下载
语言
C++
递交时间
2017-10-19 20:22:29
评测时间
2017-10-19 20:22:29
评测机
分数
50
总耗时
47ms
峰值内存
376.0 KiB