fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define main dummy_main
  5. int main(){
  6. return 0;
  7. }
  8. #undef main
  9. int r[50];
  10. int c[50];
  11. class Solution{
  12. public:
  13. int oddCells(int n, int m, vector<vector<int>>& ind){
  14. int i;
  15. int res = 0;
  16. for(i=(0);i<(n);i++){
  17. r[i] = 0;
  18. }
  19. for(i=(0);i<(m);i++){
  20. c[i] = 0;
  21. }
  22. for(i=(0);i<(ind.size());i++){
  23. r[ind[i][0]]++;
  24. }
  25. for(i=(0);i<(ind.size());i++){
  26. c[ind[i][1]]++;
  27. }
  28. for(i=(0);i<(n);i++){
  29. int j;
  30. for(j=(0);j<(m);j++){
  31. res += (r[i] + c[j]) % 2;
  32. }
  33. }
  34. return res;
  35. }
  36. }
  37. ;
  38. // cLay varsion 20191108-1
  39.  
  40. // --- original code ---
  41. // #define main dummy_main
  42. // {}
  43. // #undef main
  44. //
  45. // int r[50], c[50];
  46. //
  47. // class Solution {
  48. // public:
  49. // int oddCells(int n, int m, vector<vector<int>>& ind) {
  50. // int res = 0;
  51. // rep(i,n) r[i] = 0;
  52. // rep(i,m) c[i] = 0;
  53. // rep(i,ind.size()) r[ind[i][0]]++;
  54. // rep(i,ind.size()) c[ind[i][1]]++;
  55. // rep(i,n) rep(j,m) res += (r[i] + c[j]) % 2;
  56. // return res;
  57. // }
  58. // };
  59.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty