fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. long long crossProd_L(long long x1, long long y1, long long x2, long long y2){
  5. return x1 * y2 - x2 * y1;
  6. }
  7. #define main dummy_main
  8. int main(){
  9. return 0;
  10. }
  11. #undef main
  12. int N;
  13. int X[1000];
  14. int Y[1000];
  15. class Solution{
  16. public:
  17. bool checkStraightLine(vector<vector<int>>& in){
  18. int i;
  19. N = in.size();
  20. for(i=(0);i<(N);i++){
  21. X[i] = in[i][0];
  22. Y[i] = in[i][1];
  23. }
  24. for(i=(1);i<(N);i++){
  25. X[i] -= X[0];
  26. Y[i] -= Y[0];
  27. }
  28. for(i=(2);i<(N);i++){
  29. if(crossProd_L(X[1],Y[1],X[i],Y[i])){
  30. return false;
  31. }
  32. }
  33. return true;
  34. }
  35. }
  36. ;
  37. // cLay varsion 20191102-1
  38.  
  39. // --- original code ---
  40. // #define main dummy_main
  41. // {}
  42. // #undef main
  43. //
  44. // int N, X[1000], Y[1000];
  45. //
  46. // class Solution {
  47. // public:
  48. // bool checkStraightLine(vector<vector<int>>& in) {
  49. // N = in.size();
  50. // rep(i,N) X[i] = in[i][0], Y[i] = in[i][1];
  51. // rep(i,1,N) X[i] -= X[0], Y[i] -= Y[0];
  52. // rep(i,2,N) if(crossProd(X[1],Y[1],X[i],Y[i])) return false;
  53. // return true;
  54. // }
  55. // };
  56.  
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