[luoguP1227] [JSOI2008]完美的对称(sort)


传送门

排序!

#include <cstdio> #include <iostream> #include <algorithm> #define N 20001 int n; struct node a[N], b[N]; inline int read() inline bool cmp1(node x, node y) inline bool cmp2(node x, node y) int main() std::sort(a + 1, a + n + 1, cmp1); std::sort(b + 1, b + n + 1, cmp2); x = a[1].x + b[1].x; y = a[1].y + b[1].y; for(i = 2; i <= n; i++) if(a[i].x + b[i].x != x || a[i].y + b[i].y != y) x /= 2.0; y /= 2.0; printf("V.I.P. should stay at (%.1lf,%.1lf).\n", x, y); return 0; }

  



上一篇:[luoguP2948] [USACO09OPEN]滑雪课Ski Lessons(DP)

下一篇:[Vijos1067]Warcraft III 守望者的烦恼(DP + 矩阵优化)


stl
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图