fork download
  1. class Solution {
  2. public:
  3. int countLatticePoints(vector<vector<int>>& cir) {
  4. int cnt=0;
  5. for(int i=-102;i<202;i++)
  6. {
  7. for(int j=-102;j<202;j++)
  8. {
  9. for(auto v : cir)
  10. {
  11.  
  12. if((v[0]-i)*(v[0]-i) + (v[1]-j)*(v[1]-j) <= v[2]*v[2])
  13. {
  14. cnt++;
  15. break;
  16. }
  17. }
  18. }
  19. }
  20. return cnt;
  21. }
  22. };
  23.  
  24.  
  25.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:28: error: ‘vector’ has not been declared
     int countLatticePoints(vector<vector<int>>& cir) {
                            ^~~~~~
prog.cpp:3:34: error: expected ‘,’ or ‘...’ before ‘<’ token
     int countLatticePoints(vector<vector<int>>& cir) {
                                  ^
prog.cpp: In member function ‘int Solution::countLatticePoints(int)’:
prog.cpp:9:30: error: ‘cir’ was not declared in this scope
                 for(auto v : cir)
                              ^~~
stdout
Standard output is empty