HDU1214--圆桌会议 HDU(90)
2013-08-11 15:30
204 查看
#include <stdio.h> #include <iostream> #include <cmath> #include <cstring> using namespace std; int main(){ int n; while(cin>>n) { int x,f,z; f=n/2; x=n-f; z=f*(f-1)/2+x*(x-1)/2; cout<<z<<endl; } return 0; }
对于圆环来说,最好的办法就是对半分。
关于排序问题,就是1,2,3,4,5,6,->6,5,4,3,2,1即可,所以就是6冒泡上去,1冒泡下来。
圆环就是两段分别这么做,然后相加就好。
所以就1A。
相关文章推荐
- HDU 1214圆桌会议
- HDU 1214 圆桌会议(思维)
- HDU 1214 圆桌会议 【找规律】
- HDU 1214 圆桌会议
- HDU 圆桌会议 - 数学题
- HDU-圆桌会议问题
- HDU 1214 圆桌会议 圆环逆序
- hdu1214 圆桌会议(数学:题意难懂+水题)
- 【数学】HDU 1214 圆桌会议
- HDU1214 圆桌会议 水规律
- hdu 1214 圆桌会议
- HDU 1214 圆桌会议 圆环逆序
- HDU - 1214 圆桌会议
- hdu1214-圆桌会议
- HDU 1214 圆桌会议
- hdu1214 圆桌会议
- Hdu 1214 圆桌会议
- hdu 1214 圆桌会议
- hdu1214 圆桌会议 水题
- HDU-1214-圆桌会议(初等数论)