Skip to content

Instantly share code, notes, and snippets.

@yukpiz
Created April 13, 2015 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukpiz/788477078249ad012b40 to your computer and use it in GitHub Desktop.
Save yukpiz/788477078249ad012b40 to your computer and use it in GitHub Desktop.
"price" problem code of paiza.
/*
* [Compile]
* g++ -std=c++11 price.cpp -o price
*/
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main(
int arg,
char **args)
{
int a, b, r;
cin >> a >> b >> r;
int count;
cin >> count;
vector< vector<int> > points;
for (int i = 0; i < count; i++) {
int x, y;
cin >> x >> y;
vector<int> point{x, y};
points.push_back(point);
}
for (int i = 0; i < points.size(); i++) {
string answer;
answer = pow(points[i][0] - a, 2) + pow(points[i][1] - b, 2) >= pow(r, 2) ? "silent" : "noisy";
cout << answer << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment