摘要
题目链接 |
难度等级 |
完成状态 |
完成分数 |
最后编辑时间 |
需要注意
|
Canvas Frames
|
★☆☆☆☆
|
答案正确
|
100
|
2015-02-14 13:55:41
|
无
|
题意
给出一些线段,求最多能造出几个正方形。
题解
就是找出对边凑就好了。不同长度的木棍数量整数方式除以2,求个和,再整数方式除以2即可。同签到题。
代码
127B.cpp代码已折叠
展开折叠内容
|
- #include<cstdio>
- #include<cmath>
- #define si(n) scanf("%d",&n)
- #define f(i,n) for(int i=1;i<=n;++i)
- #define ci const int &
- int a[1000]={},ans=0;
- int main()
- {
- int n,x;
- si(n);
- f(i,n)
- {
- si(x);
- ++a[x];
- }
- f(i,100)
- {
- ans+=a[i]>>1;
- }
- printf("%d",ans>>1);
- return 0;
- }
|