| 记录编号 | 186723 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1809.[NOIP 2014PJ]珠心算测试 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.006 s | ||
| 提交时间 | 2015-09-14 20:26:40 | 内存使用 | 0.31 MiB | ||
#include <fstream>
#include <algorithm>
using namespace std;
int main()
{
ifstream fin("countb.in");
ofstream fout("countb.out");
int i,j,k,m,count[10001],ans=0,more[10001];
fin>>m;
for(i=1;i<=m;i++)
{
fin>>count[i];
more[i]=count[i];
}
sort(count,count+m+1);
sort(more,more+m+1);
for(j=1;j<=m;j++)
for(k=2;k<=m;k++)
for(i=1;i<=m;i++)
{
if((count[j]+count[k]==more[i])&&j!=k&&count[i]!=count[j])
{
ans++;
more[i]=0;
}
}
fout<<ans<<endl;
fin.close();
fout.close();
return 0;
}