Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC omptimize("unroll-loops")
- #pragma GCC optimize("no-stack-protector")
- #include <bits/stdc++.h>
- using namespace std;
- int n;
- int x[1000];
- int y[1000];
- vector <double> s;
- bool comppp (int a,int b) {
- return (a>b);
- }
- int main () {
- #ifdef LOCAL
- freopen("moria.in", "r", stdin);
- freopen("moria.out", "w", stdout);
- #endif
- int m , n;
- cin >> m >> n;
- s.resize(m );
- //cout << m << endl;
- for(int i = 0; i < m; i++) {
- cin >> x[i] >> y[i];
- }
- // cout << x[0] << endl;
- // cout << y[0] << endl;
- for(int i = 0; i < m; i++) {
- s[i] = sqrt(pow(x[i] , 2) + pow(y[i], 2));
- }
- // for(int i = 0; i < s.size(); i++) cout << s[i] << " ";
- //cout << endl;
- sort(s.begin(), s.end());
- //for(int i = 0; i < s.size(); i++) cout << s[i] << " ";
- //cout << endl;
- //cout << s[n] << endl;
- int l = round(pow(s[n], 2));
- cout << l;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement