AcWing 5297. 坐标变换(其一)
原题链接
简单
作者:
Krishya
,
2025-03-14 00:02:12
·北京
,
所有人可见
,
阅读 1
#include <iostream>
#include <vector>
using namespace std;
const int N = 110;
int dx[N], dy[N];
int main(){
int n, m;
cin >> n >> m; // 操作个数n和初始坐标个数m
for(int i = 0; i < n; i++){
cin >> dx[i] >> dy[i]; // dx=[10,0,10], dy=[10,0,-20]
}
vector<pair<int, int>> position(m);
for(int j = 0; j < m; j++){
int x, y;
cin >> x >> y;
position[j] = {x, y};
for(int i = 0; i < n; i++){
position[j].first += dx[i];
position[j].second += dy[i];
}
cout << position[j].first << " " << position[j].second << endl;
}
return 0;
}