我是靠谱客的博主 沉默手链,这篇文章主要介绍CF1091B New Year and the Treasure Geolocation,现在分享给大家,希望可以做个参考。

题目只让我们求最后宝藏的位置,没让我们求怎么匹配,所以我们可以考虑不求出具体匹配方案

观察一下发现,最终的结果就是 ( s u m x / n , s u m y / n ) (sum_x/n,sumy/n) (sumx/n,sumy/n)

代码:

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<bits/stdc++.h> using namespace std; #define read(x) scanf("%d",&x) #define ll long long int main() { int n; ll sum1=0,sum2=0; read(n); for(int i=1;i<=2*n;i++) { int x; read(x),sum1+=x; read(x),sum2+=x; } printf("%I64d %I64d",sum1/n,sum2/n); return 0; }

最后

以上就是沉默手链最近收集整理的关于CF1091B New Year and the Treasure Geolocation的全部内容,更多相关CF1091B内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部