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. class Solution{
  10. public:
  11. int smallestCommonElement(vector<vector<int>>& A){
  12. int i;
  13. int x;
  14. int y;
  15. map<int,int> mp;
  16. x = A.size();
  17. y = A[0].size();
  18. for(i=(0);i<(x);i++){
  19. int j;
  20. for(j=(0);j<(y);j++){
  21. if(j && A[i][j] == A[i][j-1]){
  22. continue;
  23. }
  24. if(++mp[A[i][j]] == x){
  25. return A[i][j];
  26. }
  27. }
  28. }
  29. return -1;
  30. }
  31. }
  32. ;
  33. // cLay varsion 20190921-1
  34.  
  35. // --- original code ---
  36. // #define main dummy_main
  37. // {}
  38. // #undef main
  39. //
  40. // class Solution {
  41. // public:
  42. // int smallestCommonElement(vector<vector<int>>& A) {
  43. // int x, y;
  44. // map<int,int> mp;
  45. // x = A.size();
  46. // y = A[0].size();
  47. // rep(i,x) rep(j,y){
  48. // if(j && A[i][j] == A[i][j-1]) continue;
  49. // if(++mp[A[i][j]] == x) return A[i][j];
  50. // }
  51. // return -1;
  52. // }
  53. // };
  54.  
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