fork download
  1. int W, H, N;
  2. int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
  3.  
  4. bool fld[[MAX_N * 3][MAX_N * 3];
  5.  
  6. int compress(int *x1, int *x2, int w){
  7. vector<int> xs;
  8.  
  9. for(int i = 0; i < N; i++){
  10. for(int d = -1; d <= 1; d++){
  11. int tx1 = x1[i]+d, tx2 = x2[i]+d;
  12. if(1 <= x1 && x1 <= W) xs.push_back(tx1);
  13. if(1 <= x2 && x2 <= W) xs.push_back(tx2);
  14. }
  15. }
  16.  
  17. sort(xs.begin(), xs.end());
  18. xs.erase(unique(xs.begin(), xs.end()), xs.end());
  19. for( int i = 0; i < N; i++){
  20. x1[i] = find(xs.begin(), xs.end(), x1[i]) - xs.begin();
  21. x2[i] = find(xs.begin(), xs.end(), x2[i]) - xs.begin();
  22. }
  23.  
  24. return xs.size();
  25. }
  26.  
  27. void solve(){
  28. W = compress(X1, X2, W);
  29. H = compress(Y1, Y2, H);
  30. .....
  31.  
  32. //以下略
  33. }
  34. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:8: error: 'MAX_N' was not declared in this scope
 int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
        ^
prog.cpp:2:19: error: 'MAX_N' was not declared in this scope
 int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
                   ^
prog.cpp:2:30: error: 'MAX_N' was not declared in this scope
 int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
                              ^
prog.cpp:2:41: error: 'MAX_N' was not declared in this scope
 int X1[MAX_N], X2[MAX_N], Y1[MAX_N], Y2[MAX_N];
                                         ^
prog.cpp:4:17: error: expected ']' before '*' token
 bool fld[[MAX_N * 3][MAX_N * 3];
                 ^
prog.cpp:4:31: warning: 'MAX_N' attribute directive ignored [-Wattributes]
 bool fld[[MAX_N * 3][MAX_N * 3];
                               ^
prog.cpp: In function 'int compress(int*, int*, int)':
prog.cpp:7:2: error: 'vector' was not declared in this scope
  vector<int> xs;
  ^
prog.cpp:7:9: error: expected primary-expression before 'int'
  vector<int> xs;
         ^
prog.cpp:12:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if(1 <= x1 && x1 <= W) xs.push_back(tx1);
            ^
prog.cpp:12:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if(1 <= x1 && x1 <= W) xs.push_back(tx1);
                        ^
prog.cpp:12:27: error: 'xs' was not declared in this scope
    if(1 <= x1 && x1 <= W) xs.push_back(tx1);
                           ^
prog.cpp:13:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if(1 <= x2 && x2 <= W) xs.push_back(tx2);
            ^
prog.cpp:13:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    if(1 <= x2 && x2 <= W) xs.push_back(tx2);
                        ^
prog.cpp:13:27: error: 'xs' was not declared in this scope
    if(1 <= x2 && x2 <= W) xs.push_back(tx2);
                           ^
prog.cpp:17:7: error: 'xs' was not declared in this scope
  sort(xs.begin(), xs.end());
       ^
prog.cpp:17:27: error: 'sort' was not declared in this scope
  sort(xs.begin(), xs.end());
                           ^
prog.cpp:18:38: error: 'unique' was not declared in this scope
  xs.erase(unique(xs.begin(), xs.end()), xs.end());
                                      ^
prog.cpp:20:43: error: 'find' was not declared in this scope
   x1[i] = find(xs.begin(), xs.end(), x1[i]) - xs.begin();
                                           ^
prog.cpp: In function 'void solve()':
prog.cpp:28:15: error: 'X1' was not declared in this scope
  W = compress(X1, X2, W);
               ^
prog.cpp:28:19: error: 'X2' was not declared in this scope
  W = compress(X1, X2, W);
                   ^
prog.cpp:29:15: error: 'Y1' was not declared in this scope
  H = compress(Y1, Y2, H);
               ^
prog.cpp:29:19: error: 'Y2' was not declared in this scope
  H = compress(Y1, Y2, H);
                   ^
prog.cpp:30:2: error: expected primary-expression before '...' token
  .....
  ^
prog.cpp: At global scope:
prog.cpp:34:1: error: expected declaration before '}' token
 }
 ^
stdout
Standard output is empty