Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: 曹北健(37509)
- Result: AC Submission_id: 5154435
- Created at: Sat Mar 04 2023 12:44:46 GMT+0800 (China Standard Time)
- Problem: 6681 Time: 8 Memory: 1632
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
- #include <ctype.h>
- #include <time.h>
- #pragma warning(disable:4996 6031)
- int main(){
- #ifdef _DEBUG
- freopen("../../input.txt", "r", stdin);
- #endif // _DEBUG
- int n, i;
- long long x0, y0, dx, dy, xc, yc, r;
- char input[128] = { 0 };
- fgets(input, 127, stdin);
- sscanf(input, "%d", &n);
- fgets(input, 127, stdin);
- sscanf(input, "(%lld, %lld)", &x0, &y0);
- fgets(input, 127, stdin);
- sscanf(input, "%lld%lld%lld", &xc, &yc, &r);
- for(i = 0; i < n; i++){
- fgets(input, 127, stdin);
- sscanf(input, "(%lld, %lld)", &dx, &dy);
- x0 += dx; y0 += dy;
- }
- if(((xc - x0) * (xc - x0) + (yc - y0) * (yc - y0)) <= (r * r)){
- puts("N0 WAY!");
- }
- else{
- printf("(%lld, %lld)\n", x0, y0);
- }
- #ifdef _DEBUG
- freopen("CON", "r", stdin);
- //freopen("CON", "w", stdout);
- system("pause");
- #endif // _DEBUG
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement