Advertisement
zaidhuda

Untitled

Sep 19th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. int p = 0;
  2.  
  3. REP(testx, 100){
  4. REP(testy, 100){
  5. int c = 0;
  6. for (int i = 0, j = n-1; i < n; j = i++) {
  7. if ( ((point[i][1]>testy) != (point[j][1]>testy)) &&
  8. (testx <= (point[j][0]-point[i][0]) * (testy-point[i][1])+1 / (point[j][1]-point[i][1])+2 + point[i][0]) )
  9. c = !c;
  10. }
  11. p += c;
  12. }
  13. }
  14.  
  15. cout << p << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement