Advertisement
wojiaocbj

Untitled

Mar 8th, 2023
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.16 KB | None | 0 0
  1. /*
  2.  Author: 曹北健(37509)
  3.  Result: AC Submission_id: 5154435
  4.  Created at: Sat Mar 04 2023 12:44:46 GMT+0800 (China Standard Time)
  5.  Problem: 6681  Time: 8 Memory: 1632
  6. */
  7.  
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <string.h>
  11. #include <math.h>
  12. #include <ctype.h>
  13. #include <time.h>
  14. #pragma warning(disable:4996 6031)
  15. int main(){
  16. #ifdef _DEBUG
  17.     freopen("../../input.txt", "r", stdin);
  18. #endif // _DEBUG
  19.     int n, i;
  20.     long long x0, y0, dx, dy, xc, yc, r;
  21.     char input[128] = { 0 };
  22.     fgets(input, 127, stdin);
  23.     sscanf(input, "%d", &n);
  24.     fgets(input, 127, stdin);
  25.     sscanf(input, "(%lld, %lld)", &x0, &y0);
  26.     fgets(input, 127, stdin);
  27.     sscanf(input, "%lld%lld%lld", &xc, &yc, &r);
  28.     for(i = 0; i < n; i++){
  29.         fgets(input, 127, stdin);
  30.         sscanf(input, "(%lld, %lld)", &dx, &dy);
  31.         x0 += dx; y0 += dy;
  32.     }
  33.     if(((xc - x0) * (xc - x0) + (yc - y0) * (yc - y0)) <= (r * r)){
  34.         puts("N0 WAY!");
  35.     }
  36.     else{
  37.         printf("(%lld, %lld)\n", x0, y0);
  38.     }
  39. #ifdef _DEBUG
  40.     freopen("CON", "r", stdin);
  41.     //freopen("CON", "w", stdout);
  42.     system("pause");
  43. #endif // _DEBUG
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement