codeforces 24C 找规律
来源:互联网 发布:交易圣经知乎 编辑:程序博客网 时间:2024/05/01 17:58
X轴与Y轴独立,且当n为奇数时,循环节为2*n。
#include <bits/stdc++.h>#define aint(x) x.begin(), x.end()using namespace std;typedef long long LL;const int maxn = 111;const int pi = acos(-1.0);struct Point { int x, y; Point(int x = 0, int y = 0):x(x),y(y) {}; void getin() { scanf("%d%d", &x, &y); }};Point Getpair(Point a, Point b) { return {2*b.x - a.x, 2*b.y-a.y};}vector<int> X, Y;int main() { Point s; vector<Point> V; int n; long long m; scanf("%d%lld", &n, &m);s.getin(); for(int i = 1; i <= n; i++) { Point tmp; tmp.getin(); V.push_back(tmp); } for(int i = 1; i <= 2; i++) for(auto it:V) { s = Getpair(s, it); X.push_back(s.x); Y.push_back(s.y); } printf("%d %d\n", X[(m-1)%(2*n)], Y[(m-1)%(2*n)]); return 0;}
阅读全文
0 0
- codeforces 24C 找规律
- Codeforces 520C. DNA Alignment 找规律
- CodeForces 337C 找规律 ,等比数列求和
- CodeForces 631C Report(找规律)
- codeforces-141【B找规律】【C思维】
- codeforces-743【B找规律】C思维】
- Codeforces Round #198 (Div. 2) C. Tourist Problem - 找规律
- Codeforces 57C Array dp暴力找规律
- Codeforces Round #264 (Div. 2)C(找规律)
- codeforces 560C Gerald's Hexagon(找规律)
- Codeforces Round #327 (Div. 2) (C. Median Smoothing 找规律)
- Codeforces - 337C(div2) - Harmony Analysis(找规律)
- CodeForces - 368C Sereja and Algorithm (找规律&模拟)
- CodeForces - 584C Marina and Vasya (模拟)找规律
- codeforces-57C Array(找规律+逆元)
- Codeforces Round #337 (Div. 2) C 找规律+构造
- CodeForces 337C Quiz(1等比数列找规律)
- CodeForces - 202C Clear Symmetry (预处理模拟+找规律)
- Oracle学前班
- Linux功耗管理(7)_Wakeup events framework
- HDU6128Inverse of sum
- Oracle数据库exp与expdp方式导入导出时改变数据库表空间及用户信息
- caffe自定义神经层
- codeforces 24C 找规律
- Python 字符串函数
- VS2010/MFC MFC 常用类:定时器 Timer
- 「网络流 24 题」运输问题
- 任务进度规划(每日更新)
- 73. Set Matrix Zeroes
- setsockopt(server_sockfd,SOL_SOCKET,SO_REUSEADDR,&j,sizeof(j));
- 编译原理工具推荐
- numpy的安装