| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
..无语 输出方案的时候 一种AC一种WA。。 这两种有区别吗?。。这是AC的
for (i=1;i<=n;i++)
{
if (!hash[i])
ans++;
if (hash[i+n])
ans++;
}
printf("%d\n",ans);
for (i=1;i<=n;i++)
{
if (!hash[i])
printf("%d -\n",i);
if (hash[i+n])
printf("%d +\n",i);
}
这是WA的
for (i=1;i<=n;i++)
if (!hash[i])
ans++;
for (i=n+1;i<=n*2;i++)
if (hash[i])
ans++;
printf("%d\n",ans);
for (i=1;i<=n;i++)
if (!hash[i])
printf("%d -\n",i);
for (i=n+1;i<=n*2;i++)
if (hash[i])
printf("%d +\n",i-n);
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator