Submission #3447

#TimeUsernameProblemLanguageResultExecution timeMemory
3447pichuliaJogging (kriii1_J)C++98
Compilation error
0 ms0 KiB
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> #include<algorithm> using namespace::std; #define M 100000005 double M_PI; struct P{ double x, y; double radis; }a[100005]; int n, m; double b[100005]; bool compare(P p, P q) { return p.radis > q.radis; } void input() { M_PI = acos(0.0)*2; int i, j; scanf("%d %d",&n,&m); for(i=0; i<n; i++) { scanf("%lf %lf",&a[i].x,&a[i].y); a[i].radis = atan2(a[i].y, a[i].x + M); } for(i=0; i<m; i++) scanf("%lf",&b[i]); sort(a,a+n,compare); } void process() { int i, j=0; double k; for(i=0; i<m; i++) { k=0; for(; j<n; j++) { k = atan2(a[j].y,a[j].x - b[i]); if(k<M_PI/2) break; } printf("%.7lf\n",k); } } void output() { } int main() { input(); process(); output(); return 0; }

Compilation message (stderr)

J.cpp:11:8: error: expected unqualified-id before numeric constant
J.cpp: In function 'void input()':
J.cpp:26:19: error: lvalue required as left operand of assignment
J.cpp:27:9: warning: unused variable 'j' [-Wunused-variable]
J.cpp:28:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
J.cpp:31:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
J.cpp:35:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]