比赛 20120316 评测结果 AAAAAAAAAA
题目名称 数字填充 最终得分 100
用户昵称 苏轼 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2012-03-16 20:36:14
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
int n,q[2501],ji=1,answer=1000000,ans=0;
bool used[2501]={0};
int main()
{
	freopen ("coupons.in","r",stdin);
	freopen ("coupons.out","w",stdout);
	cin>>n;
	cout<<n*n+n/2+1;
	/*if (n<=30)
	{
		for (int i=1;i<=n*n;i++)
		{
			ji=1;
			used[i]=1;
			dfs(i);
		}
		cout<<answer;
		return 0;
	}
	else
	{
		//suan2();
		cout<<answer;
		return 0;
	}*/
	return 0;
}

/*void dfs(int x)
{
	q[ji]=x;
	if (ji%n==1)
	{
		if (ji>n)
		{
			ans=max(q[ji]+q[ji-n],ans);
		}
	}
	else
	{
		if (ji>n)
		{
			ans=max(q[ji]+q[ji-n],ans);
			ans=max(ans,q[ji]+q[ji-1]);
		}
		else if (ji<n)
		{
			ans=max(ans,q[ji]+q[ji-1]);
		}
	}
	if (ji==n*n)
	{
		if (ans<answer)
		{
			for (int i=1;i<=n;i++)
			{
				for (int j=1;j<=n;j++)
				{
					cout<<q[(i-1)*n+j]<<' ';
				}
				cout<<endl;
			}
		}
		answer=min(ans,answer);
		return;
	}
	for (int i=1;i<=n*n;i++)
	{
		if (!used[i])
		{
			int a;
			a=ans;
			ji++;
			used[i]=1;
			dfs(i);
			ans=a;
			used[i]=0;
			ji--;
		}
	}
}*/