| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 428658 | Hazem | Rectangles (IOI19_rect) | C++14 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "rect.h"#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) {
n = a.size();m = a[0].size(); assert(n<=3);
if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
Compilation message (stderr)
rect.cpp:1:18: warning: extra tokens at end of #include directive
1 | #include "rect.h"#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) {
| ^
rect.cpp:3:241: error: stray '#' in program
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^
rect.cpp:3:266: error: stray '#' in program
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^
rect.cpp:2:1: error: 'n' does not name a type
2 | n = a.size();m = a[0].size(); assert(n<=3);
| ^
rect.cpp:2:14: error: 'm' does not name a type
2 | n = a.size();m = a[0].size(); assert(n<=3);
| ^
rect.cpp:2:37: error: expected constructor, destructor, or type conversion before '(' token
2 | n = a.size();m = a[0].size(); assert(n<=3);
| ^
rect.cpp:3:1: error: expected unqualified-id before 'if'
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~
rect.cpp:3:34: error: 'LL' does not name a type
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~
rect.cpp:3:46: error: expected unqualified-id before 'for'
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~
rect.cpp:3:58: error: 'i' does not name a type
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^
rect.cpp:3:64: error: 'i' does not name a type
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^
rect.cpp:3:229: error: expected unqualified-id before 'return'
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~~~~
rect.cpp:3:240: error: expected declaration before '}' token
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^
rect.cpp:3:242: error: 'include' does not name a type
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~~~~~
rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:3:494: error: 'LL' was not declared in this scope
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~
rect.cpp:3:575: error: 'max' was not declared in this scope; did you mean 'std::max'?
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~
| std::max
In file included from /usr/include/c++/10/vector:60,
from rect.h:5,
from rect.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: 'std::max' declared here
300 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
rect.cpp:3:639: error: 'ans' was not declared in this scope
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~
rect.cpp:3:696: error: 'ans' was not declared in this scope
3 | if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}#include <bits/stdc++.h> #define LL long long using namespace std; const int N = 250; int n,m;int col[N][N][N],row[N][N][N]; long long count_rectangles(std::vector<std::vector<int> > a) { n = a.size();m = a[0].size(); if(n<3) return 0; bool q = 1; LL ans = 0; for(int i=1;i<m-1;i++){ int mx = 0; for(int j=i;j<m-1;j++){ mx = max(mx,a[1][j]); q &= (a[1][j]<a[0][j])&&(a[1][j]<a[2][j]); ans += 0ll+(q&(mx<a[1][i-1]&&mx<a[1][j+1])); } } return ans;}
| ^~~