submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s710605179
p00091
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<climits> #include<string> #include<vector> #include<list> #include<map> #include<set> #include<cmath> #include<queue> using namespace std; struct Ink{ int y,x,size; Ink(){} Ink(int _y,int _x,int _size){ y=_y; x=_x; size=_size; } }; const int blur_x[3][4] = {{0,1,0,-1},{1,1,-1,-1},{0,2,0,-2}}, blur_y[3][4] = {{-1,0,1,0},{-1,1,1,-1},{-2,0,2,0}}; int N; bool ansflag; void dfs(int fld[10][10],vector<Ink> ink){ if(ansflag==true) return; bool flag=true; for(int i=0;i<10;i++){ for(int j=0;j<10;j++){ //printf("%d ",fld[i][j]); int fld_c[10][10]; memcpy(fld_c,fld,sizeof(fld)); if(--fld_c[i][j]<0) continue; flag = false; for(int k=0;k<3;k++){ for(int l=0;l<4;l++){ int ny,nx; ny = i+blur_y[k][l]; nx = j+blur_x[k][l]; if(ny<0 || 10<=ny || nx<0 || 10<=nx || --fld_c[ny][nx]<0) goto NEXT; } ink.push_back(Ink(i,j,k+1)); int fld_cc[10][10]; memcpy(fld_cc,fld_c,sizeof(fld)); dfs(fld_cc,ink); ink.pop_back(); } NEXT:; }//puts(""); }//puts(""); if(flag==true && ink.size()==N){ for(int i=0;i<ink.size();i++){ printf("%d %d %d\n",ink[i].x,ink[i].y,ink[i].size); } ansflag = true; return; } } int main(){ int fld[10][10]; cin>>N; for(int i=0;i<10;i++){ for(int j=0;j<10;j++){ cin>>fld[i][j]; } } vector<Ink> ink; dfs(fld,ink); return 0; }
a.cc: In function 'void dfs(int (*)[10], std::vector<Ink>)': a.cc:34:49: warning: 'sizeof' on array function parameter 'fld' will return size of 'int (*)[10]' [-Wsizeof-array-argument] 34 | memcpy(fld_c,fld,sizeof(fld)); | ~^~~~ a.cc:27:14: note: declared here 27 | void dfs(int fld[10][10],vector<Ink> ink){ | ~~~~^~~~~~~~~~~ a.cc:34:25: error: 'memcpy' was not declared in this scope 34 | memcpy(fld_c,fld,sizeof(fld)); | ^~~~~~ a.cc:12:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 11 | #include<queue> +++ |+#include <cstring> 12 | using namespace std; a.cc:46:60: warning: 'sizeof' on array function parameter 'fld' will return size of 'int (*)[10]' [-Wsizeof-array-argument] 46 | memcpy(fld_cc,fld_c,sizeof(fld)); | ~^~~~ a.cc:27:14: note: declared here 27 | void dfs(int fld[10][10],vector<Ink> ink){ | ~~~~^~~~~~~~~~~
s243640283
p00091
C++
#include <bits/stdc++.h> using namespace std; const int dx[] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; const int dy[] = {0, 0, -1, 0, 1, 1, -1, -1, 1, 0, -2, 0, 2}; const int size[] = {5, 9, 13}; typedef vector<int> Vi; typedef vector<Vi> VVi; typedef tuple<int, int, int> T; bool ingrid(int i, int j) { return i >= 0 && i < 10 && j >= 0 && j < 10; } set<VVi> done; vector<T> search(int n, VVi grid) { if (done.count(grid)) return vector<T>(0); done.insert(grid); if (!n){ int f = 0; for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ f |= grid[i][j]; } } vector<T> t; if (!f) t.push_back(T(-1, -1, -1)); return t; } for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ for (int s = 0; s < 3; s++){ bool f = false; for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; if (--grid[i + dx[d]][j + dy[d]] < 0){ f = true; } } if (!f){ vector<T> tmp = search(n - 1, grid); if (tmp.size()){ tmp.push_back(T(i, j, s)); return tmp; } } for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; grid[i + dx[d]][j + dy[d]]++; } } } } return vector<T>(0); } int main() { int n; VVi grid(10, Vi(10)); scanf("%d", &n); for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ scanf("%d", &grid[i][j]); } } vector<T> res = search(n, grid); for (int i = 1; i <= n; i++){ int x = get<0>(res[i]); int y = get<1>(res[i]); int s = get<2>(res[i]); printf("%d %d %d\n", y, x, ++s); } return 0; }
a.cc: In function 'std::vector<std::tuple<int, int, int> > search(int, VVi)': a.cc:40:53: error: reference to 'size' is ambiguous 40 | for (int d = 0; d < size[s]; d++){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~ a.cc:53:53: error: reference to 'size' is ambiguous 53 | for (int d = 0; d < size[s]; d++){ | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~
s771206736
p00091
C++
#include <bits/stdc++.h> using namespace std; const int dx[] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; const int dy[] = {0, 0, -1, 0, 1, 1, -1, -1, 1, 0, -2, 0, 2}; const int size[] = {5, 9, 13}; typedef vector<int> Vi; typedef vector<Vi> VVi; typedef tuple<int, int, int> T; bool ingrid(int i, int j) { return i >= 0 && i < 10 && j >= 0 && j < 10; } set<VVi> done; vector<T> search(int n, VVi grid) { if (done.count(grid)) return vector<T>(0); if (!n){ int f = 0; for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ f |= grid[i][j]; } } vector<T> t; if (!f) t.push_back(T(-1, -1, -1)); return t; } for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ for (int s = 0; s < 3; s++){ bool f = false; for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; if (--grid[i + dx[d]][j + dy[d]] < 0){ f = true; } } if (!f){ vector<T> tmp = search(n - 1, grid); if (tmp.size()){ tmp.push_back(T(i, j, s)); return tmp; } } for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; grid[i + dx[d]][j + dy[d]]++; } } } } done.insert(grid); return vector<T>(0); } signed main() { int n; VVi grid(10, Vi(10)); scanf("%d", &n); for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ scanf("%d", &grid[i][j]); } } vector<T> res = search(n, grid); for (int i = 1; i <= n; i++){ int x = get<0>(res[i]); int y = get<1>(res[i]); int s = get<2>(res[i]); printf("%d %d %d\n", y, x, ++s); } return 0; }
a.cc: In function 'std::vector<std::tuple<int, int, int> > search(int, VVi)': a.cc:39:53: error: reference to 'size' is ambiguous 39 | for (int d = 0; d < size[s]; d++){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~ a.cc:52:53: error: reference to 'size' is ambiguous 52 | for (int d = 0; d < size[s]; d++){ | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~
s697606194
p00091
C++
#include <bits/stdc++.h> using namespace std; const int dx[] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; const int dy[] = {0, 0, -1, 0, 1, 1, -1, -1, 1, 0, -2, 0, 2}; const int size[] = {5, 9, 13}; typedef vector<int> Vi; typedef vector<Vi> VVi; typedef tuple<int, int, int> T; bool ingrid(int i, int j) { return i >= 0 && i < 10 && j >= 0 && j < 10; } set<VVi> done; vector<T> search(int n, VVi& grid) { if (done.count(grid)) return vector<T>(0); if (!n){ int f = 0; for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ f |= grid[i][j]; } } vector<T> t; if (!f) t.push_back(T(-1, -1, -1)); return t; } for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ for (int s = 0; s < 3; s++){ bool f = false; for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; if (--grid[i + dx[d]][j + dy[d]] < 0){ f = true; } } if (!f){ vector<T> tmp = search(n - 1, grid); if (tmp.size()){ tmp.push_back(T(i, j, s)); return tmp; } } for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; grid[i + dx[d]][j + dy[d]]++; } } } } done.insert(grid); return vector<T>(0); } signed main() { int n; VVi grid(10, Vi(10)); scanf("%d", &n); for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ scanf("%d", &grid[i][j]); } } vector<T> res = search(n, grid); for (int i = 1; i <= n; i++){ int x = get<0>(res[i]); int y = get<1>(res[i]); int s = get<2>(res[i]); printf("%d %d %d\n", y, x, ++s); } return 0; }
a.cc: In function 'std::vector<std::tuple<int, int, int> > search(int, VVi&)': a.cc:39:53: error: reference to 'size' is ambiguous 39 | for (int d = 0; d < size[s]; d++){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~ a.cc:52:53: error: reference to 'size' is ambiguous 52 | for (int d = 0; d < size[s]; d++){ | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:6:11: note: 'const int size [3]' 6 | const int size[] = {5, 9, 13}; | ^~~~
s819618127
p00091
C++
#include <bits/stdc++.h> using namespace std; #define int short const int dx[] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; const int dy[] = {0, 0, -1, 0, 1, 1, -1, -1, 1, 0, -2, 0, 2}; const int size[] = {5, 9, 13}; typedef vector<int> Vi; typedef vector<Vi> VVi; typedef tuple<int, int, int> T; bool ingrid(int i, int j) { return i >= 0 && i < 10 && j >= 0 && j < 10; } set<VVi> done; vector<T> search(int n, VVi& grid) { if (done.count(grid)) return vector<T>(0); if (!n){ int f = 0; for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ f |= grid[i][j]; } } vector<T> t; if (!f) t.push_back(T(-1, -1, -1)); return t; } for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ for (int s = 0; s < 3; s++){ bool f = false; for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; if (--grid[i + dx[d]][j + dy[d]] < 0){ f = true; } } if (!f){ vector<T> tmp = search(n - 1, grid); if (tmp.size()){ tmp.push_back(T(i, j, s)); return tmp; } } for (int d = 0; d < size[s]; d++){ if (!ingrid(i + dx[d], j + dy[d])) continue; grid[i + dx[d]][j + dy[d]]++; } } } } done.insert(grid); return vector<T>(0); } signed main() { signed n; VVi grid(10, Vi(10)); scanf("%d", &n); for (int i = 0; i < 10; i++){ for (int j = 0; j < 10; j++){ int d; scanf("%d", &d); grid[i][j] = (short)d; } } vector<T> res = search(n, grid); for (int i = 1; i <= n; i++){ int x = get<0>(res[i]); int y = get<1>(res[i]); int s = get<2>(res[i]); printf("%d %d %d\n", y, x, ++s); } return 0; }
a.cc: In function 'std::vector<std::tuple<short int, short int, short int> > search(short int, VVi&)': a.cc:41:53: error: reference to 'size' is ambiguous 41 | for (int d = 0; d < size[s]; d++){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:8:11: note: 'const short int size [3]' 8 | const int size[] = {5, 9, 13}; | ^~~~ a.cc:54:53: error: reference to 'size' is ambiguous 54 | for (int d = 0; d < size[s]; d++){ | ^~~~ /usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])' 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:262:5: note: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)' 262 | size(const _Container& __cont) noexcept(noexcept(__cont.size())) | ^~~~ a.cc:8:11: note: 'const short int size [3]' 8 | const int size[] = {5, 9, 13}; | ^~~~
s926269417
p00091
C++
#include<iostream> #include<vector> #include<set> using namespace std; #define r(a) for(int a=0;a<10;a++) struct pain{short int x,y,s,t;}; vector<pain>vec; set<vector<short int> >se; short int n; vector<vector<short int> >c(10,vector<short int>(10,0)); short int s(short int i,short int j){ if(!i||!j||i==9||j==9)return 0;return min(c[i][j],min(c[i-1][j],min(c[i+1][j],min(c[i][j+1],c[i][j-1])))); return 0; } short int m(short int i,short int j){ return min(s(i,j),min(c[i-1][j-1],min(c[i-1][j+1],min(c[i+1][j-1],c[i+1][j+1])))); } short int l(short int i,short int j){ return min(m(i,j),min(c[i-2][j],min(c[i+2][j],min(c[i][j-2],c[i][j+2])))); } void ds(short int i,short int j,short int ma){ c[i][j]-=ma;c[i-1][j]-=ma;c[i+1][j]-=ma;c[i][j+1]-=ma;c[i][j-1]-=ma; } void dm(short int i,short int j,short int ma){ c[i-1][j-1]-=ma;c[i-1][j+1]-=ma;c[i+1][j-1]-=ma;c[i+1][j+1]-=ma; } void dl(short int i,short int j,short int ma){ c[i-2][j]-=ma;c[i+2][j]-=ma;c[i][j-2]-=ma;c[i][j+2]-=ma; } void is(short int i,short int j,short int ma){ c[i][j]+=ma;c[i-1][j]+=ma;c[i+1][j]+=ma;c[i][j+1]+=ma;c[i][j-1]+=ma; } void im(short int i,short int j,short int ma){ c[i-1][j-1]+=ma;c[i-1][j+1]+=ma;c[i+1][j-1]+=ma;c[i+1][j+1]+=ma; } void il(short int i,short int j,short int ma){ c[i-2][j]+=ma;c[i+2][j]+=ma;c[i][j-2]+=ma;c[i][j+2]+=ma; } bool eval(){ int suc=1; r(a)r(b) if(c[a][b])suc=0; if(suc){ for(int k=0;k<vec.size();k++) while(vec[k].t--)cout<<vec[k].y<<" "<<vec[k].x<<" "<<vec[k].s<<endl; return 1; } return 0; } bool eva(short int i,short int j){ int suc=1; for(int a=0;a<i-2;a++)for(int b=0;b<j-2;b++) if(c[a][b])suc=0; return suc; } vector<short int> tr(vector<vector<short int> >vec){ vector<short int>v; for(int i=0;i<10;i++) for(int j=0;j<10;j++) v.push_back(c[i][j]); return v; } bool dfs(int i,int j){ if(i>1&&i<8&&j>1&&j<8){ if(l(i,j)){ pain tp; tp.x=i;tp.y=j; tp.t=0; tp.s=3; vec.push_back(tp); short int m1=l(i,j); dl(i,j,m1);dm(i,j,m1);ds(i,j,m1); vec[vec.size()-1].t=m1; if(!eva(i,j))goto n1; if(se.find(tr(c))!=se.end())goto n1; if(eval())return 1; r(a)r(b) if(s(a,b)&&dfs(a,b)) return 1; se.insert(tr(c)); n1: il(i,j,m1);im(i,j,m1);is(i,j,m1); vec.pop_back(); } } if(i>0&&i<9&&j>0&&j<9){ if(m(i,j)){ pain tp; tp.x=i;tp.y=j; tp.t=0; tp.s=2; vec.push_back(tp); short int m1=m(i,j); dm(i,j,m1);ds(i,j,m1); vec[vec.size()-1].t=m1; if(!eva(i,j))goto n2; if(se.find(tr(c))!=se.end())goto n2; if(eval())return 1; r(a)r(b) if(s(a,b)&&dfs(a,b)) return 1; se.insert(tr(c)); n2: im(i,j,m1);is(i,j,m1); vec.pop_back(); } if(s(i,j)){ tp.s=1; vec.push_back(tp); short int m1=s(i,j); ds(i,j,m1); tp.s=1; vec[vec.size()-1].t=m1; if(!eva(i,j))goto n3; if(se.find(tr(c))!=se.end())goto n3; if(eval())return 1; r(a)r(b) if(s(a,b)&&dfs(a,b)) return 1; se.insert(tr(c)); n3: is(i,j,m1); vec.pop_back(); } } return 0; } int main(){ cin>>n; r(i)r(j) cin>>c[i][j]; r(i)r(j){ if(s(i,j))dfs(i,j); } }
a.cc: In function 'bool dfs(int, int)': a.cc:99:13: error: 'tp' was not declared in this scope; did you mean 'tr'? 99 | tp.s=1; | ^~ | tr
s626853636
p00091
C++
n_drop, cloth = int(input()), [[int(i) for i in input().split()] for _ in range(10)] n_stain = sum(sum(i) for i in cloth) n = (n_stain - 5 * n_drop) // 4 drops_candidate = [] dl = 0 while 2 * dl <= n: dm = n - 2 * dl ds = n_drop - dm - dl if ds >= 0: drops_candidate.append([ds, dm, dl]) dl += 1 sdxy = ((0, 0), (-1, 0), (1, 0), (0, -1), (0, 1)) mdxy = sdxy + ((-1, -1), (-1, 1), (1, -1), (1, 1)) ldxy = mdxy + ((-2, 0), (2, 0), (0, -2), (0, 2)) dxys = (sdxy, mdxy, ldxy) def remove(cloth, x, y, drop_size): if drop_size == 2 and (not 1 < x < 8 or not 1 < y < 8): return False for dxy in dxys[drop_size]: (dx, dy) = dxy if cloth[y + dy][x + dx]: cloth[y + dy][x + dx] -= 1 else: return False return True def find(cloth, drops, history): for d in range(3): if not drops[d]: continue (start, stop) = (1, 9) if d < 2 else (2, 8) for y in range(start, stop): for x in range(start, stop): for dxy in dxys[d]: (dx, dy) = dxy if not cloth[y + dy][x + dx]: break else: new_cloth, new_drops, new_history = [r[:] for r in cloth], drops[:], history[:] for dxy in dxys[d]: (dx, dy) = dxy new_cloth[y + dy][x + dx] -= 1 new_drops[d] -= 1 new_history.append((x, y, d + 1)) if sum(new_drops): result = find(new_cloth, new_drops, new_history) if result: return result else: return new_history return False for drops in drops_candidate: history = find(cloth, drops, []) if history != False: for h in history: print(*h) break
a.cc:1:1: error: 'n_drop' does not name a type 1 | n_drop, cloth = int(input()), [[int(i) for i in input().split()] for _ in range(10)] | ^~~~~~
s920211579
p00091
C++
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<map> #include<set> #include<utility> #include<cmath> #include<cstring> #include<queue> #include<cstdio> #include<sstream> #include<iomanip> #define loop(i,a,b) for(int i=a;i<b;i++) #define rep(i,a) loop(i,0,a) #define pb push_back #define mp make_pair #define all(in) in.begin(),in.end() #define shosu(x) fixed<<setprecision(x) using namespace std; //kaewasuretyuui typedef long long ll; typedef pair<int,int> pii; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<pii> vp; typedef vector<vp> vvp; typedef pair<int,pii> pip; typedef vector<pip>vip ; const double PI=acos(-1); const double EPS=1e-8; const int inf=1e8; int n; vvi in; vip out; int dx[]={-1,0,0,0,1,1,1,-1,-1,2,0,0,-2}; int dy[]={0,-1,0,1,0,1,-1,1,-1,0,2,-2,0}; int co[3]={0,5,9,13}; bool f(int x,int y,int c){ if(c==0){ bool h=true; rep(i,10)rep(j,10)if(in[i][j])h=false; if(!h)return false; rep(i,n)cout<<out[i].first<<" "<<out[i].second.first<<" "<< out[i].second.second<<endl; return true; } rep(i,10)rep(j,10){ if(i+j==0)i=x,j=y; if(in[i][j]){ rep(k,3){ bool h=true; loop(l,co[k],co[k+1])if(i+dx[l]<0||j+dy[l]<0||i+dx[l]>=10||j+dy[l]>=10||in[i+dx[l]][j+dy[l]]==0)h=false; if(!h)break; out[c-1]=pip(j,pii(i,k+1)); rep(l,co[k])in[i+dx[l]][j+dy[l]]--; if(f(i,j,c-1))return true; rep(l,co[k])in[i+dx[l]][j+dy[l]]++; } } } return false; } int main(){ cin>>n; in=vvi(10,vi(10)); out=vip(n); rep(i,10)rep(j,10)cin>>in[i][j]; f(0,0,n); }
a.cc:38:20: error: too many initializers for 'int [3]' 38 | int co[3]={0,5,9,13}; | ^
s547053416
p00091
C++
#include<iostream> #include<queue> #include<vector> #include<tuple> #include<algorithm> using namespace std; vector<vector<__int8>>S; bool dp[13][160]; vector<tuple<vector<vector<short>>, int, vector<tuple<short, short, short>>>>Vec; vector<vector<short>> solve(vector<vector<short>>p, int x, int y, int r) { if (r == 1) { p[x][y]--; p[x + 1][y]--; p[x - 1][y]--; p[x][y - 1]--; p[x][y + 1]--; } if (r == 2) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; } if (r == 3) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; p[x + 2][y]--; p[x][y + 2]--; p[x - 2][y]--; p[x][y - 2]--; } return p; } bool hantei(vector<vector<short>>p) { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (p[i][j] < 0)return false; } } bool OKs[10][10]; for (int i = 0; i < 100; i++)OKs[i / 10][i % 10] = false; for (int i = 1; i < 9; i++) { for (int j = 1; j < 9; j++) { if (p[i][j] == 0)continue; if (p[i - 1][j] >= 1 && p[i + 1][j] >= 1 && p[i][j - 1] >= 1 && p[i][j + 1] >= 1) { OKs[i][j] = true; OKs[i - 1][j] = true; OKs[i][j - 1] = true; OKs[i][j + 1] = true; OKs[i + 1][j] = true; } bool OK4 = true; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)if (p[i + k][j + l] == 0)OK4 = false; if (OK4 == false)continue; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)OKs[i + k][j + l] = true; } } for (int i = 0; i <= 9; i++) { for (int j = 0; j <= 9; j++) { if (OKs[i][j] == false && p[i][j] >= 1)return false; } } return true; } void zen_shori() { vector<vector<short>>ZERO; queue<tuple<vector<vector<short>>, int, vector<tuple<short, short, short>>>>Q2; vector<tuple<short, short, short>>ZERO3; for (int i = 0; i < 10; i++) { vector<short>ZERO5(10, 0); ZERO.push_back(ZERO5); } Q2.push(make_tuple(ZERO, 0, ZERO3)); while (!Q2.empty()) { vector<vector<short>>a1 = get<0>(Q2.front()); int a2 = get<1>(Q2.front()); vector<tuple<short, short, short>>a3 = get<2>(Q2.front()); Vec.push_back(make_tuple(a1, a2, a3)); Q2.pop(); if (a2 == 2)continue; int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; for (int i = 1; i <= 3; i++) { for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { vector<vector<short>>a4 = solve(a1, j, k, i); vector<tuple<short, short, short>>a5 = a3; a5.push_back(make_tuple(j, k, i)); Q2.push(make_tuple(a4, a2 + 1, a5)); } } } } for (int i = 0; i < Vec.size(); i++) { for (int j = 0; j < 10; j++) { for (int k = 0; k < 10; k++) { get<0>(Vec[i])[j][k] *= -1; } } } sort(Vec.begin(), Vec.end()); } int main() { int n; cin >> n; dp[0][0] = true; for (int i = 0; i < 12; i++) { for (int j = 0; j < 160; j++) { if (dp[i][j] == false)continue; dp[i + 1][j + 5] = true; dp[i + 1][j + 9] = true; dp[i + 1][j + 13] = true; } } for (int i = 0; i < 10; i++) { vector<short>V(10, 0); S.push_back(V); } vector<vector<short>>START = S; int SUM = 0; for (int i = 0; i < 10; i++)for (int j = 0; j < 10; j++) { cin >> S[i][j]; SUM += S[i][j]; } queue<tuple<vector<vector<short>>, int, vector<tuple<short, short, short>>, int>> Q; vector<tuple<short, short, short>>ZERO; Q.push(make_tuple(S, 0, ZERO, SUM)); zen_shori(); while (!Q.empty()) { vector<vector<short>>a1 = get<0>(Q.front()); int a2 = get<1>(Q.front()); vector<tuple<short, short, short>>a3 = get<2>(Q.front()); int a4 = get<3>(Q.front()); Q.pop(); int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; for (int i = 1; i <= 3; i++) { int rem1 = a4 - P[i], rem2 = n - (a2 + 1); bool OK = true; if (dp[rem2][rem1] == false)OK = false; if (OK == false)continue; int LIM = 0; if (a3.size() >= 1) LIM = get<0>(a3[a3.size() - 1]) * 10 + get<1>(a3[a3.size() - 1]); for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { int DD = j * 10 + k; if (DD < LIM) continue; vector<vector<short>>G = solve(a1, j, k, i); vector<tuple<short,short,short>>H = a3; if (hantei(G) == false)goto F; H.push_back(make_tuple(j, k, i)); if (G == START && a2 + 1 == n) { for (int j = 0; j < H.size(); j++) { cout << get<1>(H[j]) << ' ' << get<0>(H[j]) << ' ' << get<2>(H[j]) << endl; } goto E; } if (a2 + 1 >= 10) { int P = lower_bound(Vec.begin(), Vec.end(), make_tuple(G, 0, ZERO)) - Vec.begin(); if (P < Vec.size() && get<0>(Vec[P]) == G) { for (int j = 0; j < H.size(); j++) { cout << get<1>(H[j]) << ' ' << get<0>(H[j]) << ' ' << get<2>(H[j]) << endl; } vector<tuple<short, short, short>>J = get<2>(Vec[P]); for (int j = 0; j < J.size(); j++) { cout << get<1>(J[j]) << ' ' << get<0>(J[j]) << ' ' << get<2>(J[j]) << endl; } goto E; } } Q.push(make_tuple(G, a2 + 1, H, a4 - P[i])); F:; } } } } E:; return 0; }
a.cc:7:15: error: '__int8' was not declared in this scope; did you mean 'u_int'? 7 | vector<vector<__int8>>S; | ^~~~~~ | u_int a.cc:7:15: error: template argument 1 is invalid a.cc:7:15: error: template argument 2 is invalid a.cc:7:21: error: template argument 1 is invalid 7 | vector<vector<__int8>>S; | ^~ a.cc:7:21: error: template argument 2 is invalid a.cc: In function 'int main()': a.cc:79:65: error: request for member 'push_back' in 'S', which is of non-class type 'int' 79 | for (int i = 0; i < 10; i++) { vector<short>V(10, 0); S.push_back(V); } | ^~~~~~~~~ a.cc:80:38: error: conversion from 'int' to non-scalar type 'std::vector<std::vector<short int> >' requested 80 | vector<vector<short>>START = S; int SUM = 0; | ^ a.cc:81:76: error: invalid types 'int[int]' for array subscript 81 | for (int i = 0; i < 10; i++)for (int j = 0; j < 10; j++) { cin >> S[i][j]; SUM += S[i][j]; } | ^ a.cc:81:92: error: invalid types 'int[int]' for array subscript 81 | for (int i = 0; i < 10; i++)for (int j = 0; j < 10; j++) { cin >> S[i][j]; SUM += S[i][j]; } | ^ a.cc:84:15: error: no matching function for call to 'std::queue<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int> >::push(std::tuple<int, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>)' 84 | Q.push(make_tuple(S, 0, ZERO, SUM)); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/queue:66, from a.cc:2: /usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>; _Sequence = std::deque<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>, std::allocator<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int> > >; value_type = std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>]' 283 | push(const value_type& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:283:30: note: no known conversion for argument 1 from 'std::tuple<int, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>' to 'const std::queue<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int> >::value_type&' {aka 'const std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>&'} 283 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>; _Sequence = std::deque<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>, std::allocator<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int> > >; value_type = std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>]' 288 | push(value_type&& __x) | ^~~~ /usr/include/c++/14/bits/stl_queue.h:288:25: note: no known conversion for argument 1 from 'std::tuple<int, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>' to 'std::queue<std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int> >::value_type&&' {aka 'std::tuple<std::vector<std::vector<short int, std::allocator<short int> >, std::allocator<std::vector<short int, std::allocator<short int> > > >, int, std::vector<std::tuple<short int, short int, short int>, std::allocator<std::tuple<short int, short int, short int> > >, int>&&'} 288 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~
s103788182
p00091
C++
#include<iostream> #include<queue> #include<vector> #include<tuple> #include<algorithm> #include<csdtlib> #include<ctime> using namespace std; vector<vector<char>>S; bool dp[13][160]; int LIM2 = 0; vector<vector<char>> solve(vector<vector<char>>p, int x, int y, int r) { if (r == 1) { p[x][y]--; p[x + 1][y]--; p[x - 1][y]--; p[x][y - 1]--; p[x][y + 1]--; } if (r == 2) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; } if (r == 3) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; p[x + 2][y]--; p[x][y + 2]--; p[x - 2][y]--; p[x][y - 2]--; } return p; } bool hantei(vector<vector<char>>p) { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (p[i][j] < 0)return false; } } bool OKs[10][10]; for (int i = 0; i < 100; i++)OKs[i / 10][i % 10] = false; for (int i = 1; i < 9; i++) { for (int j = 1; j < 9; j++) { if (p[i][j] == 0)continue; if (p[i - 1][j] >= 1 && p[i + 1][j] >= 1 && p[i][j - 1] >= 1 && p[i][j + 1] >= 1) { OKs[i][j] = true; OKs[i - 1][j] = true; OKs[i][j - 1] = true; OKs[i][j + 1] = true; OKs[i + 1][j] = true; } bool OK4 = true; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)if (p[i + k][j + l] == 0)OK4 = false; if (OK4 == false)continue; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)OKs[i + k][j + l] = true; } } for (int i = 0; i <= 9; i++) { for (int j = 0; j <= 9; j++) { if (OKs[i][j] == false && p[i][j] >= 1)return false; } } return true; } vector<tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>>>Vec; void zen_shori() { int JJ = 165; if (LIM2 == 2)JJ = 25000; for (int i = 0; i < JJ; i++) { tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>>ZZ; Vec.push_back(ZZ); } vector<vector<char>>ZERO; int LL = 0, RR = 0; vector<tuple<char, char, char>>ZERO3; for (int i = 0; i < 10; i++) { vector<char>ZERO5(10, 0); ZERO.push_back(ZERO5); } Vec[0] = make_tuple(ZERO, 0, ZERO3); RR++; while (LL < RR && RR < JJ) { vector<vector<char>>a1 = get<0>(Vec[LL]); int a2 = get<1>(Vec[LL]); vector<tuple<char, char, char>>a3 = get<2>(Vec[LL]); LL++; if (a2 == LIM2)continue; int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; for (int i = 1; i <= 3; i++) { for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { vector<vector<char>>a4 = solve(a1, j, k, i); vector<tuple<char, char, char>>a5 = a3; a5.push_back(make_tuple(j, k, i)); if (RR < JJ) { Vec[RR] = make_tuple(a4, a2 + 1, a5); RR++; } } } } } for (int i = 0; i < Vec.size(); i++) { for (int j = 0; j < 10; j++) { for (int k = 0; k < 10; k++) { get<0>(Vec[i])[j][k] *= -1; } } } sort(Vec.begin(), Vec.end()); } int main() { srand((unsigned)time(NULL)); int n; cin >> n; dp[0][0] = true; LIM2 = 2; for (int i = 0; i < 12; i++) { for (int j = 0; j < 160; j++) { if (dp[i][j] == false)continue; dp[i + 1][j + 5] = true; dp[i + 1][j + 9] = true; dp[i + 1][j + 13] = true; } } for (int i = 0; i < 10; i++) { vector<char>V(10, 0); S.push_back(V); } vector<vector<char>>START = S; int SUM = 0; for (int i = 0; i < 10; i++)for (int j = 0; j < 10; j++) { int SS; cin >> SS; S[i][j] = SS; SUM += S[i][j]; } queue<tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>, int>> Q; vector<tuple<char, char, char>>ZERO; Q.push(make_tuple(S, 0, ZERO, SUM)); zen_shori(); int counts = 0; while (!Q.empty()) { vector<vector<char>>a1 = get<0>(Q.front()); int a2 = get<1>(Q.front()); vector<tuple<char, char, char>>a3 = get<2>(Q.front()); int a4 = get<3>(Q.front()); Q.pop(); int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; counts++; if (rand() % 3 <= 1 && counts >= 20000 && n == 12)continue; for (int i = 1; i <= 3; i++) { int rem1 = a4 - P[i], rem2 = n - (a2 + 1); bool OK = true; if (dp[rem2][rem1] == false)OK = false; if (OK == false)continue; int LIM = 0; if (a3.size() >= 1) LIM = get<0>(a3[a3.size() - 1]) * 10 + get<1>(a3[a3.size() - 1]); for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { int DD = j * 10 + k; if (DD < LIM) continue; vector<vector<char>>G = solve(a1, j, k, i); vector<tuple<char, char, char>>H = a3; if (hantei(G) == false)goto F; H.push_back(make_tuple(j, k, i)); if (G == START && a2 + 1 == n) { for (int j = 0; j < H.size(); j++) { cout << (int)get<1>(H[j]) << ' ' << (int)get<0>(H[j]) << ' ' << (int)get<2>(H[j]) << endl; } goto E; } if (a2 + 1 >= n - LIM2) { int P = lower_bound(Vec.begin(), Vec.end(), make_tuple(G, 0, ZERO)) - Vec.begin(); if (P < Vec.size() && get<0>(Vec[P]) == G) { for (int j = 0; j < H.size(); j++) { cout << (int)get<1>(H[j]) << ' ' << (int)get<0>(H[j]) << ' ' << (int)get<2>(H[j]) << endl; } vector<tuple<char, char, char>>J = get<2>(Vec[P]); for (int j = 0; j < J.size(); j++) { cout << (int)get<1>(J[j]) << ' ' << (int)get<0>(J[j]) << ' ' << (int)get<2>(J[j]) << endl; } goto E; } } Q.push(make_tuple(G, a2 + 1, H, a4 - P[i])); F:; } } } } E:; return 0; }
a.cc:6:9: fatal error: csdtlib: No such file or directory 6 | #include<csdtlib> | ^~~~~~~~~ compilation terminated.
s165557104
p00091
C++
#include<iostream> #include<queue> #include<vector> #include<tuple> #include<cstdlib> #include<ctime> #include<algorithm> using namespace std; vector<vector<char>>S; bool dp[13][160]; int LIM2 = 0; vector<vector<char>> solve(vector<vector<char>>p, int x, int y, int r) { if (r == 1) { p[x][y]--; p[x + 1][y]--; p[x - 1][y]--; p[x][y - 1]--; p[x][y + 1]--; } if (r == 2) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; } if (r == 3) { for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++)p[x + i][y + j]--; p[x + 2][y]--; p[x][y + 2]--; p[x - 2][y]--; p[x][y - 2]--; } return p; } bool isgood(int p) { if (p % 4 == 1 && p >= 5)return true; if (p % 4 == 2 && p >= 10)return true; if (p % 4 == 3 && p >= 15)return true; if (p % 4 == 0 && p >= 20)return true; return false; } bool hantei(vector<vector<char>>p) { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (p[i][j] < 0)return false; } } bool OKs[10][10]; for (int i = 0; i < 100; i++)OKs[i / 10][i % 10] = false; for (int i = 1; i < 9; i++) { for (int j = 1; j < 9; j++) { if (p[i][j] == 0)continue; if (p[i - 1][j] >= 1 && p[i + 1][j] >= 1 && p[i][j - 1] >= 1 && p[i][j + 1] >= 1) { OKs[i][j] = true; OKs[i - 1][j] = true; OKs[i][j - 1] = true; OKs[i][j + 1] = true; OKs[i + 1][j] = true; } bool OK4 = true; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)if (p[i + k][j + l] == 0)OK4 = false; if (OK4 == false)continue; for (int k = -1; k <= 1; k++)for (int l = -1; l <= 1; l++)OKs[i + k][j + l] = true; } } for (int i = 0; i <= 9; i++) { for (int j = 0; j <= 9; j++) { if (OKs[i][j] == false && p[i][j] >= 1)return false; } } queue<pair<int, int>>Q3; bool OK5[10][10]; for (int i = 0; i < 100; i++)OK5[i / 10][i % 10] = false; for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { if (p[i][j] == 0 || OK5[i][j] == false)continue; vector<int>sc; Q3.push(make_pair(i, j)); OK5[i][j] = true; sc.push_back(p[i][j]); int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 }; while (!Q3.empty()) { int a11 = Q3.front().first, a12 = Q3.front().second; Q3.pop(); for (int k = 0; k < 4; k++) { int cx = a11 + dx[k], cy = a12 + dy[k]; if (cx < 0 || cx >= 10 || cy < 0 || cy >= 10)continue; if (p[cx][cy] == 0 || OK5[cx][cy] == true)continue; Q3.push(make_pair(cx, cy)); sc.push_back(p[cx][cy]); OK5[cx][cy] = true; } } int sums = 0; for (int i = 0; i < sc.size(); i++)sums += sc[i]; if (isgood(sums) == false)return false; } } if (rand() % 10 == 0 && n == 12)return false; return true; } vector<tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>>>Vec; void zen_shori() { int JJ = 165; if (LIM2 == 2)JJ = 25000; for (int i = 0; i < JJ; i++) { tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>>ZZ; Vec.push_back(ZZ); } vector<vector<char>>ZERO; int LL = 0, RR = 0; vector<tuple<char, char, char>>ZERO3; for (int i = 0; i < 10; i++) { vector<char>ZERO5(10, 0); ZERO.push_back(ZERO5); } Vec[0] = make_tuple(ZERO, 0, ZERO3); RR++; while (LL < RR && RR < JJ) { vector<vector<char>>a1 = get<0>(Vec[LL]); int a2 = get<1>(Vec[LL]); vector<tuple<char, char, char>>a3 = get<2>(Vec[LL]); LL++; if (a2 == LIM2)continue; int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; for (int i = 1; i <= 3; i++) { for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { vector<vector<char>>a4 = solve(a1, j, k, i); vector<tuple<char, char, char>>a5 = a3; a5.push_back(make_tuple(j, k, i)); if (RR < JJ) { Vec[RR] = make_tuple(a4, a2 + 1, a5); RR++; } } } } } for (int i = 0; i < Vec.size(); i++) { for (int j = 0; j < 10; j++) { for (int k = 0; k < 10; k++) { get<0>(Vec[i])[j][k] *= -1; } } } sort(Vec.begin(), Vec.end()); } int main() { srand((unsigned)time(NULL)); int n; cin >> n; dp[0][0] = true; LIM2 = 2; for (int i = 0; i < 12; i++) { for (int j = 0; j < 160; j++) { if (dp[i][j] == false)continue; dp[i + 1][j + 5] = true; dp[i + 1][j + 9] = true; dp[i + 1][j + 13] = true; } } for (int i = 0; i < 10; i++) { vector<char>V(10, 0); S.push_back(V); } vector<vector<char>>START = S; int SUM = 0; for (int i = 0; i < 10; i++)for (int j = 0; j < 10; j++) { int SS; cin >> SS; S[i][j] = SS; SUM += S[i][j]; } queue<tuple<vector<vector<char>>, int, vector<tuple<char, char, char>>, int>> Q; vector<tuple<char, char, char>>ZERO; Q.push(make_tuple(S, 0, ZERO, SUM)); zen_shori(); while (!Q.empty()) { vector<vector<char>>a1 = get<0>(Q.front()); int a2 = get<1>(Q.front()); vector<tuple<char, char, char>>a3 = get<2>(Q.front()); int a4 = get<3>(Q.front()); Q.pop(); int L[4] = { 0,1,1,2 }, R[4] = { 9,8,8,7 }, P[4] = { 0,5,9,13 }; for (int i = 1; i <= 3; i++) { int rem1 = a4 - P[i], rem2 = n - (a2 + 1); bool OK = true; if (dp[rem2][rem1] == false)OK = false; if (OK == false)continue; int LIM = 0; if (a3.size() >= 1) LIM = get<0>(a3[a3.size() - 1]) * 10 + get<1>(a3[a3.size() - 1]); for (int j = L[i]; j <= R[i]; j++) { for (int k = L[i]; k <= R[i]; k++) { int DD = j * 10 + k; if (DD < LIM) continue; vector<vector<char>>G = solve(a1, j, k, i); vector<tuple<char, char, char>>H = a3; if (hantei(G) == false)continue; H.push_back(make_tuple(j, k, i)); if (G == START && a2 + 1 == n) { for (int j = 0; j < H.size(); j++) { cout << (int)get<1>(H[j]) << ' ' << (int)get<0>(H[j]) << ' ' << (int)get<2>(H[j]) << endl; } goto E; } if (a2 + 1 >= n - LIM2) { int P = lower_bound(Vec.begin(), Vec.end(), make_tuple(G, 0, ZERO)) - Vec.begin(); if (P < Vec.size() && get<0>(Vec[P]) == G) { for (int j = 0; j < H.size(); j++) { cout << (int)get<1>(H[j]) << ' ' << (int)get<0>(H[j]) << ' ' << (int)get<2>(H[j]) << endl; } vector<tuple<char, char, char>>J = get<2>(Vec[P]); for (int j = 0; j < J.size(); j++) { cout << (int)get<1>(J[j]) << ' ' << (int)get<0>(J[j]) << ' ' << (int)get<2>(J[j]) << endl; } goto E; } } Q.push(make_tuple(G, a2 + 1, H, a4 - P[i])); } } } } E:; return 0; }
a.cc: In function 'bool hantei(std::vector<std::vector<char> >)': a.cc:67:33: error: 'n' was not declared in this scope 67 | if (rand() % 10 == 0 && n == 12)return false; | ^
s665643526
p00091
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #include <vector> #include <stack> #include <queue> #include <random> #include <cstdlib> #include <cmath> #include <sstream> using namespace std; #define R 10 #define PSIZE 5 //????????????????????????14*14????????????????????£???????????????????????? //??¢?´¢?????§????????????????????§????????? //??¨?????£????????????????????????????????????????????????????????????????????£?????? int T[10][10]; int N; //????????????????????¨???????????????????????????????????¶??????????????????????????????????????´ //?????´????????????center??§???????????´ int mid = (PSIZE - 1) / 2; int p[3][5][5] = { {0,0,1,0,0, 0,1,1,1,0, 0,0,1,0,0, 0,0,0,0,0, 0,0,0,0,0}, {0,0,1,1,1, 0,0,1,1,1, 0,0,1,1,1, 0,0,0,0,0, 0,0,0,0,0}, {0,0,1,0,0, 0,1,1,1,0, 1,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0} }; //{2,0}??????????????????????????? int center[3][2] = { {0,1},{1,1},{0,2} }; int psize[] = { 3,3,5 }; void add_point(int x, int y, int point[5][5]) { for (int i = 0; i < PSIZE; i++) { for (int j = 0; j < PSIZE; j++) { if (point[i][j]) T[y + i][x + j - mid] += point[i][j]; } } } void delete_point(int x, int y, int point[5][5]) { for (int i = 0; i < PSIZE; i++) { for (int j = 0; j < PSIZE; j++) { if (point[i][j]) T[y + i][x + j - mid] -= point[i][j]; } } } bool can_delete(int x, int y, int point[5][5]) { for (int i = 0; i < PSIZE; i++) { for (int j = 0; j < PSIZE; j++) { if (y + i < 0 || y + i >= R || x + j - mid < 0 || x + j - mid >= R) if (point[i][j]) return false; if (T[y + i][x + j - mid] - point[i][j] < 0) return false; } } return true; } bool checkT() { for (int i = 0; i < R; i++) { for (int j = 0; j < R; j++) { if (T[i][j] != 0) return false; } } return true; } vector<pair< pair<int, int>, int> > points; bool rec(int x, int y, int cnt) { if (checkT()) return true; if (cnt == N) return false; for (; !T[y][x];) { y += (x == 9 ? 1 : 0); x = (x + 1) % 10; if (y == 10) return false; } for (int i = 0; i < 3; i++) { if (!can_delete(x, y, p[i])) continue; delete_point(x, y, p[i]); points.push_back(make_pair(make_pair(x + center[i][0], y + center[i][1]), i)); if (rec(x, y, cnt + 1)) return true; points.pop_back(); add_point(x, y, p[i]); } return false; } void q91() { cin >> N; for (int i = 0; i < R; i++) { for (int j = 0; j < R; j++) { cin >> T[i][j]; } } bool ans = rec(0, 0, 0); for (auto it = points.begin(); it != points.end(); it++) { cout << (*it).first.first << " " << (*it).first.second << " " << (*it).second + 1 << endl; } }
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s305820190
p00091
C++
#include <bits/stdc++.h> using namespace std; int n; int b[10][10]; int ans_x[12], ans_y[12], ans_type[12]; bool inside(int y, int x) { return 0 <= y && y < 10 && 0 <= x && x < 10; } inline bool latte(int y, int x, int type, int d = 0) { int dx[13] = {0, 0, 1, 0, -1, -1, 1, 1, -1, 0, 2, 0, -2}; int dy[13] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; if (d == -1) { if (type == 1) b[y][x]--; for (int i = 4 * (type - 1) + 1; i <= 4 * type; ++i) { int ny = y + dy[i]; int nx = x + dx[i]; if (!b[ny][nx] || !inside(ny, nx)) return false; } for (int i = 0; i <= 4 * type; ++i) { int ny = y + dy[i]; int nx = x + dx[i]; b[ny][nx] += d; } return false; } for (int i = 0; i <= 4 * type; ++i) { int ny = y + dy[i]; int nx = x + dx[i]; b[ny][nx] += d; } return true; } inline bool dfs(int v = 0, int y = 0, int x = 0) { if (y == 10) return false; if (v == n) { for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { if (b[i][j]) return false; } } for (int i = 0; i < n; ++i) { printf("%d %d %d\n", ans_x[i], ans_y[i], ans_type[i]); } return true; } if (b[y][x]) { for (int i = 1; i <= 3; ++i) { if (latte(y, x, i, -1)) { ans_y[v] = y; ans_x[v] = x; ans_type[v] = i; if (dfs(v + 1, y, x)) return true; // latte(y, x, i, 1); } else { latte(y, x, i - 1, 1) } } } int nx = (x + 1) % 10; int ny = y + (x == 9); return dfs(v, ny, nx); } int main() { cin >> n; for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { cin >> b[i][j]; } } dfs(); }
a.cc: In function 'bool dfs(int, int, int)': a.cc:67:30: error: expected ';' before '}' token 67 | latte(y, x, i - 1, 1) | ^ | ; 68 | } | ~
s692807420
p00091
C++
#include <bits/stdc++.h> using namespace std; int n; int b[10][10]; int dx[13] = {0, 0, 1, 0, -1, -1, 1, 1, -1, 0, 2, 0, -2}; int dy[13] = {0, -1, 0, 1, 0, -1, -1, 1, 1, -2, 0, 2, 0}; inline bool inside(int y, int x) { return 0 <= y && y < 10 && 0 <= x && x < 10; } inline bool latte(int y, int x, int type, int d = 0) { if (d == -1) { for (int i = 0; i <= 4 * type; ++i) { int ny = y + dy[i]; int nx = x + dx[i]; if (!b[ny][nx] || !inside(ny, nx)) return false; } } for (int i = 0; i <= 4 * type; ++i) { int ny = y + dy[i]; int nx = x + dx[i]; b[ny][nx] += d; } return true; } bool dfs(int v = 0, int y = 1, int x = 1) { if (y == 9) return false; if (v == n) { for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { if (b[i][j]) return false; } } return true; } int nx = x % 8 + 1; int ny = y + (nx == 1); if (!b[y][x]) return dfs(v, ny, nx); for (int i = 1; i <= 3; ++i) { if (latte(y, x, i, -1)) { if (dfs(v + 1, y, x)) { printf("%d %d %d\n", x, y, i); return true; } latte(y, x, i, 1); } else { break; } } return dfs(v, ny, nx); } int main() { cin >> n; for (int i = 0; i < 10; ++i) { for (int j = 0; j < 10; ++j) { cin >> b[i][j]; } } dfs() }
a.cc: In function 'int main()': a.cc:71:8: error: expected ';' before '}' token 71 | dfs() | ^ | ; 72 | } | ~
s393385231
p00091
C++
import itertools dx = (0, 0, 0, 1,-1, 1, 1,-1,-1,-2, 2, 0, 0) dy = (0, 1,-1, 0, 0, 1,-1, 1,-1, 0, 0,-2, 2) dd = (5, 9, 13) def drop(fab, used, size_list): for xy in range(100): y = xy%10 x = xy//10 size = size_list[used] check = True for i in range(size): if fab[y + dy[i] + 2][x + dx[i] + 2] == 0: check = False if check: for i in range(size): fab[y + dy[i] + 2][x + dx[i] + 2] -= 1 if sum(map(sum, fab)): result = drop(fab, used + 1, size_list) if result: result.append([x, y, dd.index(size) + 1]) return result for i in range(size): fab[y + dy[i] + 2][x + dx[i] + 2] += 1 else: return [[x, y, dd.index(size) + 1]] return False fab = [[0 for i in range(14)] for j in range(14)] n = int(input()) for i in range(10): fab[i + 2][2:12] = list(map(int, input().split())) s = sum(map(sum, fab)) d_all = list(itertools.combinations_with_replacement([5,9,13], n)) d_list = [l for l in d_all if sum(l) == s] ans = [0 for i in range(n)] for d in d_list: d_tmp = sorted(d)[::-1] ans = drop(fab, 0, d_tmp) if ans: for a in ans: print(*a) break
a.cc:1:1: error: 'import' does not name a type 1 | import itertools | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s223451242
p00091
C++
ed
a.cc:1:1: error: 'ed' does not name a type 1 | ed | ^~
s251850146
p00091
C++
#include <iostream> #include <vector> #include <string.h> using namespace std; //debugFlag bool g_bDebugFlag = false; enum{ NONE = 0, SMALL = 1, MEDIUM = 2, LARGE = 3, }; enum{ FLAG_SMALL = 1 << 0, FLAG_MEDIUM = 1 << 1, FLAG_LARGE = 1 << 2, }; int smallDrop[] = { 0, 1, 0, 1, 1, 1, 0, 1, 0 }; int mediumDrop[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, }; int largeDrop[] = { 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, }; struct Result { Result() : x( 0 ), y( 0 ), size( 0 ){} Result( const int _x, const int _y, const int _size ) : x( _x ), y( _y ), size( _size ){} int x; int y; int size; }; class Drop { public: Drop( const int size ) : m_size( size ) { switch( size ){ case SMALL: //小 m_patternSize = 3; m_pattern = smallDrop; break; case MEDIUM: //中 m_patternSize = 3; m_pattern = mediumDrop; break; case LARGE: //大 m_patternSize = 5; m_pattern = largeDrop; break; } } ~Drop() { } int m_size; int m_patternSize; int* m_pattern; }; class Cloth { public: Cloth( const int dropCount ) : m_depthMax( 0 ), m_dropCount( dropCount ) { memset( m_map, 0, sizeof(m_map) ); } ~Cloth() { } void input( const int d, const int x, const int y ) { m_map[ y ][ x ] = d; if( d > m_depthMax ){ m_depthMax = d; } } vector<Result> analyze() { vector<Result> r; return rec( m_dropCount, r ); } void outputStain() { if( !g_bDebugFlag ){ return; } for( int i = 0; i < 10; ++i ){ for( int j = 0; j < 10; ++j ){ cout << m_map[ i ][ j ] << " "; } cout << endl; } cout << endl; } vector<Result> rec( const int count, vector<Result> res ) { if( count == 0 ){ outputStain(); if( isWhite() ){ return res; } return vector<Result>(); } Result r; if( removeMediumDrop( &r ) ){ removeStain( r.x - 1, r.y - 1, MEDIUM ); res.push_back( r ); return rec( count - 1, res ); } for( int y = 0; y < 10; ++y ){ for( int x = 0; x < 10; ++x ){ int sizeFlags = match( x, y ); if( sizeFlags > 0 ){ int size[ 3 ]; size[ 0 ] = sizeFlags & FLAG_LARGE ? LARGE : 0; size[ 1 ] = sizeFlags & FLAG_SMALL ? SMALL : 0; size[ 2 ] = sizeFlags & FLAG_MEDIUM ? MEDIUM : 0; for( int i = 0; i < 3; ++i ){ if( size[ i ] == 0 ) continue; removeStain( x, y, size[ i ] ); if( isPossiblePattern( x, y, size[ i ] ) ){ res.push_back( Result( x + ( size[ i ] == LARGE ? 2 : 1 ), y + ( size[ i ] == LARGE ? 2 : 1 ), size[ i ] ) ); vector<Result> ret = rec( count - 1, res ); if( ret.size() == m_dropCount ){ return ret; } res.pop_back(); } dye( x, y, size[ i ] ); } } } } return vector<Result>(); } int match( const int x, const int y ) { Drop large( LARGE ); bool mismatchL = false; for( int i = 0; i < large.m_patternSize; ++i ){ for( int j = 0; j < large.m_patternSize; ++j ){ if( ( large.m_pattern[ i * large.m_patternSize + j ] > 0 && m_map[ y + i ][ x + j ] <= 0 ) ){ mismatchL = true; break; } } if( mismatchL ){ break; } } Drop medium( MEDIUM ); Drop small( SMALL ); bool mismatchM = false; bool mismatchS = false; for( int i = 0; i < small.m_patternSize; ++i ){ for( int j = 0; j < small.m_patternSize; ++j ){ int X = x + j; int Y = y + i; int index = i * small.m_patternSize + j; if( ( small.m_pattern[ index ] > 0 && m_map[ Y ][ X ] <= 0 ) ){ mismatchS = true; } if( ( medium.m_pattern[ index ] > 0 && m_map[ Y ][ X ] <= 0 ) ){ mismatchM = true; } if( mismatchS && mismatchM ){ break; } } if( mismatchS && mismatchM ){ break; } } return 0x0 | ( mismatchL ? 0 : FLAG_LARGE ) | ( mismatchM ? 0 : FLAG_MEDIUM ) | ( mismatchS ? 0 : FLAG_SMALL ); } bool removeMediumDrop( Result* r ) { static int pattern[][ 9 ] = { { 0, 0, 0, 0, 1, 1, 0, 1, 1, }, { 0, 0, 0, 1, 1, 0, 1, 1, 0, }, { 0, 1, 1, 0, 1, 1, 0, 0, 0, }, { 1, 1, 0, 1, 1, 0, 0, 0, 0, }, }; for( int k = 0; k < 4; ++k ){ for( int y = 0; y < 7; ++y ){ for( int x = 0; x < 7; ++x ){ bool mismatch = false; for( int i = 0; i < 3; ++i ){ for( int j = 0; j < 3; ++j ){ if( ( pattern[ k ][ i * 3 + j ] > 0 && m_map[ y + i ][ x + j ] <= 0 ) || ( pattern[ k ][ i * 3 + j ] == 0 && m_map[ y + i ][ x + j ] > 0 ) ){ mismatch = true; break; } } if( mismatch ) break; } if( !mismatch ){ int retX, retY; switch( k ){ case 0: retX = x + 2; retY = y + 2; break; case 1: retX = x; retY = y + 2; break; case 2: retX = x + 2; retY = y; break; case 3: retX = x; retY = y; break; } r->size = MEDIUM; r->x = retX; r->y = retY; return true; } } } } return false; } void removeStain( const int x, const int y, const int size ) { Drop drop( size ); for( int i = 0; i < drop.m_patternSize; ++i ){ for( int j = 0; j < drop.m_patternSize; ++j ){ if( drop.m_pattern[ i * drop.m_patternSize + j ] ){ --m_map[ y + i ][ x + j ]; if( m_map[ y + i ][ x + j ] < 0 ){ __debugbreak(); } } } } outputStain(); } void dye( const int x, const int y, const int size ){ Drop drop( size ); for( int i = 0; i < drop.m_patternSize; ++i ){ for( int j = 0; j < drop.m_patternSize; ++j ){ if( drop.m_pattern[ i * drop.m_patternSize + j ] ){ ++m_map[ y + i ][ x + j ]; } } } outputStain(); } bool isWhite() { for( int y = 0; y < 10; ++y ){ for( int x = 0; x < 10; ++x ){ if( m_map[ y ][ x ] ){ return false; } } } return true; } bool isPossiblePattern( const int ox, const int oy, const int size ) { static int pattern[][ 9 ] = { { 1, 1, 1, 0, 1, 0, 0, 0, 0, }, { 0, 0, 1, 0, 1, 1, 0, 0, 1, }, { 0, 0, 0, 0, 1, 0, 1, 1, 1, }, { 1, 0, 0, 1, 1, 0, 1, 0, 0, }, { 0, 1, 0, 1, 1, 1, 0, 1, 0, }, }; int patternSize = Drop( size ).m_patternSize + 4; for( int y = ( oy - 2 < 0 ? 0 : oy - 2 ); y < oy - 2 + patternSize; ++y ){ for( int x = ( ox - 2 < 0 ? 0 : ox - 2 ); x < ox - 2 + patternSize; ++x ){ if( m_map[ y + 1 ][ x + 1 ] == 0 ){ continue; } bool possible = false; for( int k = 0; k < 5; ++k ){ bool impossible = false; for( int i = 0; i < 3; ++i ){ for( int j = 0; j < 3; ++j ){ if( pattern[ k ][ i * 3 + j ] > 0 && m_map[ y + i ][ x + j ] <= 0 ){ impossible = true; break; } } if( impossible ) break; } if( !impossible ){ possible = true; break; } } if( !possible ){ return false; } } } return true; } private: int m_map[ 10 + 4 ][ 10 + 4 ]; int m_depthMax; int m_dropCount; }; int main() { int n; while( cin >> n ){ Cloth cloth( n ); for( int y = 0; y < 10; ++y ){ for( int x = 0; x < 10; ++x ){ int d; cin >> d; cloth.input( d, x, y ); } } cloth.outputStain(); vector<Result> result = cloth.analyze(); for( int i = 0; i < result.size(); ++i ){ Result r = result[ i ]; cout << r.x << " " << r.y << " " << r.size << endl; } } return 0; }
a.cc: In member function 'void Cloth::removeStain(int, int, int)': a.cc:254:49: error: '__debugbreak' was not declared in this scope 254 | __debugbreak(); | ^~~~~~~~~~~~
s103208898
p00091
C++
#include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; int pattern_small[] = { 0,1,0, 1,1,1, 0,1,0 }; int pattern_med[] = { 1,1,1, 1,1,1, 1,1,1 }; int pattern_big[] = { 0,0,1,0,0, 0,1,1,1,0, 1,1,1,1,1, 0,1,1,1,0, 0,0,1,0,0 }; int mat[12][12]; int used[12][12][5]; bool lastCheck(){ for(int y=0;y<10;y++)for(int x=0;x<10;x++){ if(mat[y][x] != 0){ return false; } } return true; } bool putValid(int y, int x, int off_y, int off_x, int h, int w, int *pattern){ int sy = y - off_y; int sx = x - off_x; int ty = sy + h - 1; int tx = sx + w - 1; if(sy < 0 || sx < 0 || ty >= 10 || tx >= 10)return false; for(int i=0;i<h;i++)for(int j=0;j<w;j++){ int ny = sy + i; int nx = sx + j; if(pattern[i*w+j] == 1 && (mat[ny][nx] <= 0)){ return false; } } return true; } bool allow(int n){ for(int i=0;i<n;i++){ int sy = i / 10; int sx = i % 10; if(mat[sy][sx] == 0)continue; bool ok = false; for(int j=n;j<100;j++){ int ty = j / 10; int tx = j % 10; int dy = abs(sy - ty); int dx = abs(sx - tx); if(dy >= 3)break; if(dy + dx <= 1 && putValid(ty, tx, 1, 1, 3, 3, pattern_small)){ ok = true; break; } if(dy <= 1 && dx <= 1 && putValid(ty, tx, 1, 1, 3, 3, pattern_med)){ ok = true; break; } if(dy + dx <= 2 && putValid(ty, tx, 2, 2, 5, 5, pattern_big)){ ok = true; break; } } if(!ok)return false; } return true; } bool update(int y, int x, int off_y, int off_x, int h, int w, int* pattern, int num){ int sy = y - off_y; int sx = x - off_x; int ty = sy + h - 1; int tx = sx + w - 1; if(sy < 0 || sx < 0 || ty >= 10 || tx >= 10)return false; for(int i=0;i<h;i++)for(int j=0;j<w;j++){ int ny = sy + i; int nx = sx + j; if(pattern[i*w+j] == 1){ if(mat[ny][nx] < num)return false; mat[ny][nx] -= num; } } return true; } bool dfs(int rest, int n){ if(rest == 0)return lastCheck(); if(n >= 10 * 10)return false; if(!allow(n))return false; int y = n / 10; int x = n % 10; if(mat[y][x] == 0){ return dfs(rest, n+1); } if(dfs(rest, n+1)){ return true; } int temp[12][12]; memcpy(temp, mat, sizeof(mat)); for(int i=0;i<=rest;i++){ for(int j=0;j<=rest-i;j++){ for(int k=0;k<=rest-i-j;k++){ int s = i + j + k; if(s == 0)continue; bool ok = true; if(ok && (i > 0) && !update(y, x, 1, 1, 3, 3, pattern_small, i))ok = false; if(ok && (j > 0) && !update(y, x, 1, 1, 3, 3, pattern_med, j))ok = false; if(ok && (k > 0) && !update(y, x, 2, 2, 5, 5, pattern_big, k))ok = false; if(ok){ used[y][x][1] = i; used[y][x][2] = j; used[y][x][3] = k; if(dfs(rest-s, n+1)){ return true; } used[y][x][1] = 0; used[y][x][2] = 0; used[y][x][3] = 0; } memcpy(mat, temp, sizeof(temp)); } } } return false; } int main() { int K; cin >> K; for(int y=0;y<10;y++)for(int x=0;x<10;x++)cin >> mat[y][x]; if(!dfs(K, 0)){ cout << "WA" << endl; } for(int y=0;y<10;y++)for(int x=0;x<10;x++){ for(int k=1;k<=3;k++){ int cnt = used[y][x][k]; for(int t=0;t<cnt;t++){ cout << x << " " << y << " " << k << endl; } } } return 0; }
a.cc: In function 'bool dfs(int, int)': a.cc:126:9: error: 'memcpy' was not declared in this scope 126 | memcpy(temp, mat, sizeof(mat)); | ^~~~~~ a.cc:5:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <sstream> +++ |+#include <cstring> 5 | using namespace std;
s380170376
p00091
C++
#include<iostream> #include<algorithm> #include<vector> #include<map> using namespace std; int a[10][10]; int rem, n; bool big(int x, int y, int r){ bool res = true; if(x - 2 < 0 || x + 2 >= 10 || y - 2 < 0 || y + 2 >= 10)return false; for(int i = x - 2;i <= x + 2;i++) for(int j = y - 2;j <= y + 2;j++) if(abs(x - i) + abs(y - j) <= 2){ a[i][j] += r; rem += r; if(a[i][j] < 0)res = false; } if(!res)big(x, y, -r); return res; } bool small(int x, int y, int r){ bool res = true; if(x - 1 < 0 || x + 1 >= 10 || y - 1 < 0 || y + 1 >= 10)return false; for(int i = x - 1;i <= x + 1;i++) for(int j = y - 1;j <= y + 1;j++) if(abs(x - i) + abs(y - j) <= 1){ a[i][j] += r; rem += r; if(a[i][j] < 0)res = false; } if(!res)small(x, y, -r); return res; } bool middle(int x, int y, int r){ bool res = true; if(x - 1 < 0 || x + 1 >= 10 || y - 1 < 0 || y + 1 >= 10)return false; for(int i = x - 1;i <= x + 1;i++) for(int j = y - 1;j <= y + 1;j++){ a[i][j] += r; rem += r; if(a[i][j] < 0)res = false; } if(!res)middle(x, y, -r); return res; } typedef pair<int, int> P; typedef pair<P, int> T; vector<T> ans; bool solve(int n,int p = 0, int q = 0){ if(rem > 13 * n)return false; if(p - 2 >= 0 && q - 1 >= 0 && a[p - 2][q - 1])return false; if(p - 1 >= 0 && q - 2 >= 0 && a[p - 1][q - 1])return false; for(int i = 0;i < 10;i++){ for(int j = 0;j < 10;j++){ if(a[i][j] > n)return false; } } if(counter() > n)return false; for(int i = p;i < 10;i++){ for(int j = 0;j < 10;j++){ if(a[i][j] == 0)continue; if(big(i, j, -1)){ ans.push_back(T(P(i, j), 3)); if(solve(n - 1, i, j))return true; ans.pop_back(); big(i, j, 1); } if(middle(i, j, -1)){ ans.push_back(T(P(i, j), 2)); if(solve(n - 1, i, j))return true; ans.pop_back(); middle(i, j, 1); } if(small(i, j, -1)){ ans.push_back(T(P(i, j), 1)); if(solve(n - 1, i, j))return true; ans.pop_back(); small(i, j, 1); } } } return (n == 0); } int main(){ cin >> n; for(int i = 0;i < 10;i++) for(int j = 0;j < 10;j++){ cin >> a[i][j]; rem += a[i][j]; } solve(n); for(int i = 0;i < ans.size();i++){ cout << ans[i].first.second << " "<< ans[i].first.first << " "<<ans[i].second << endl; } return 0; }
a.cc: In function 'bool solve(int, int, int)': a.cc:64:8: error: 'counter' was not declared in this scope 64 | if(counter() > n)return false; | ^~~~~~~
s742784553
p00091
C++
// test20.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include <iostream> #include <string> #include <vector> using namespace std; int map[12][12]; int n; bool hantei3(int x,int y){ if(map[y][x] && map[y][x-1] && map[y][x-2] && map[y][x+1] && map[y][x+2] && map[y-2][x] && map[y-1][x] && map[y+1][x] && map[y+2][x]){ if((map[y+2][x+2] == map[y][x]-1 && map[y+1][x+2] == map[y][x]-1 && map[y+2][x+1] == map[y][x]-1) || (map[y+2][x-2] == map[y][x]-1 && map[y+1][x-2] == map[y][x]-1 && map[y+2][x-1] == map[y][x]-1)|| (map[y-2][x+2] == map[y][x]-1 && map[y-1][x+2] == map[y][x]-1 && map[y-2][x+1] == map[y][x]-1)|| (map[y-2][x-2] == map[y][x]-1 && map[y-1][x-2] == map[y][x]-1 && map[y-2][x-1] == map[y][x]-1)){ map[y][x]--; map[y][x-1]--; map[y][x-2]--; map[y][x+1]--; map[y][x+2]--; map[y-2][x]--; map[y-1][x]--; map[y+1][x]--; map[y+2][x]--; return true; } } return false; } bool hantei2(int x,int y){ if(map[y][x] && map[y][x-1] && map[y][x+1] && map[y-1][x] && map[y-1][x-1] && map[y-1][x+1] && map[y+1][x] && map[y+1][x-1] && map[y+1][x+1]){ if((map[y+2][x+2] == map[y][x]-1 && map[y+1][x+2] == map[y][x]-1 && map[y+2][x+1] == map[y][x]-1) || (map[y+2][x-2] == map[y][x]-1 && map[y+1][x-2] == map[y][x]-1 && map[y+2][x-1] == map[y][x]-1)|| (map[y-2][x+2] == map[y][x]-1 && map[y-1][x+2] == map[y][x]-1 && map[y-2][x+1] == map[y][x]-1)|| (map[y-2][x-2] == map[y][x]-1 && map[y-1][x-2] == map[y][x]-1 && map[y-2][x-1] == map[y][x]-1)){ map[y][x] --; map[y][x-1] --; map[y][x+1] --; map[y-1][x] --; map[y-1][x-1] --; map[y-1][x+1] --; map[y+1][x] --; map[y+1][x-1] --; map[y+1][x+1]--; return true; } } return false; } bool hantei1(int x,int y){ if(map[y][x] && map[y+1][x] && map[y-1][x] && map[y][x+1] && map[y][x-1]){ if((map[y+1][x+1] == map[y][x]-1) || (map[y+1][x-1] == map[y][x]-1)|| (map[y-1][x+1] == map[y][x]-1)|| (map[y-1][x-1] == map[y][x]-1)){ map[y][x] --; map[y+1][x] --; map[y-1][x] --; map[y][x+1] --; map[y][x-1]--; return true; } } return false; } int _tmain(int argc, _TCHAR* argv[]) { vector<int>ans; cin >> n; for(int y=1;y<11;y++){ for(int x=1;x<11;x++){ cin >> map[y][x]; } } for(int y=3;y<9;y++){ for(int x=3;x<9;x++){ if(hantei3(x,y)){ cout << x -1 << " " << y-1 << " " << 3 << endl; } } } for(int y=2;y<10;y++){ for(int x=2;x<10;x++){ if(hantei2(x,y)){ cout << x -1 << " " << y-1 << " " << 2 << endl; } } } for(int y=2;y<10;y++){ for(int x=2;x<10;x++){ if(hantei1(x,y)){ cout << x -1 << " " << y-1 << " " << 1 << endl; } } } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s599388437
p00092
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include<stdio.h> #include<algorithm> using namespace std; int main() { int n,ans = 0; int dp[1100][1100]; char field; while(scanf("%d",&n),n) { for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) { scanf(" %c",&field); dp[j + 1][i + 1] = 0; if(field == '*')dp[j + 1][i + 1] = -1; } for(int i = 1; i < n + 1; i++) { for(int j = 1; j < n + 1; j++) { if(dp[j][i] == -1); else if(j == 1 || i == 1)dp[j][i] = 1; else dp[j][i] = max(1,min(dp[j - 1][i - 1],min(dp[j - 1][i],dp[j][i - 1])) + 1); ans = max(ans,dp[j][i]); } } /*for(int i = 1; i < n + 1; i++) { for(int j = 1; j < n + 1; j++) { printf("%2d",dp[j][i]); } printf("\n"); }*/ printf("%d\n",ans); ans = 0; } return 0; }
main.c:2:1: error: expected identifier or '(' before numeric constant 2 | 1 | ^ In file included from /usr/include/stdio.h:47, from main.c:42: /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t' 28 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' +++ |+#include <stddef.h> 1 | /* Copyright (C) 1991-2025 Free Software Foundation, Inc. /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: error: unknown type name 'size_t' 37 | size_t __nbytes); | ^~~~~~ /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:37:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:57:3: error: unknown type name 'cookie_read_function_t'; did you mean 'cookie_seek_function_t'? 57 | cookie_read_function_t *read; /* Read bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~ | cookie_seek_function_t /usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:58:3: error: unknown type name 'cookie_write_function_t'; did you mean 'cookie_close_function_t'? 58 | cookie_write_function_t *write; /* Write bytes. */ | ^~~~~~~~~~~~~~~~~~~~~~~ | cookie_close_function_t /usr/include/stdio.h:314:35: error: unknown type name 'size_t' 314 | extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) | ^~~~~~ /usr/include/stdio.h:130:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 129 | #include <bits/stdio_lim.h> +++ |+#include <stddef.h> 130 | /usr/include/stdio.h:320:47: error: unknown type name 'size_t' 320 | extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ /usr/include/stdio.h:320:47: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:340:34: error: unknown type name 'size_t' 340 | int __modes, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:340:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:346:24: error: unknown type name 'size_t' 346 | size_t __size) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/stdio.h:346:24: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:385:44: error: unknown type name 'size_t' 385 | extern int snprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:385:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:389:45: error: unknown type name 'size_t' 389 | extern int vsnprintf (char *__restrict __s, size_t __maxlen, | ^~~~~~ /usr/include/stdio.h:389:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:690:30: error: unknown type name 'size_t' 690 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:690:30: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:693:28: error: unknown type name 'size_t' 693 | size_t *__restrict __n, int __delimiter, | ^~~~~~ /usr/include/stdio.h:693:28: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:698:27: error: unknown type name 'size_t' 698 | size_t *__restrict __n, | ^~~~~~ /usr/include/stdio.h:698:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:8: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:728:46: error: unknown type name 'size_t' 728 | extern size_t fread (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:728:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:729:22: error: unknown type name 'size_t' 729 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:729:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:8: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:735:53: error: unknown type name 'size_t' 735 | extern size_t fwrite (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:735:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:736:23: error: unknown type name 'size_t' 736 | size_t __n, FILE *__restrict __s) __nonnull((4)); | ^~~~~~ /usr/include/stdio.h:736:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:8: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:756:55: error: unknown type name 'size_t' 756 | extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:756:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:757:31: error: unknown type name 'size_t' 757 | size_t __n, FILE *__restrict __stream) __wur | ^~~~~~ /usr/include/stdio.h:757:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:8: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:759:62: error: unknown type name 'size_t' 759 | extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, | ^~~~~~ /usr/include/stdio.h:759:62: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdio.h:760:32: error: unknown type name 'size_t' 760 | size_t __n, FILE *__restrict __stream) | ^~~~~~ /usr/include/stdio.h:760:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' main.c:43:9: fatal error: algorithm: No such file or directory 43 | #include<algorithm> | ^~~~~~~~~~~ compilation terminated.
s708370934
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> int map[1000][1000]; int index[1001][1001][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] =='*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } #if 0 for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); } printf("\n"); } #endif max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:7:13: error: 'index' redeclared as different kind of symbol 7 | int index[1001][1001][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s166061575
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> char map[1000][1000]; int index[1001][1001][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] =='*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } #if 0 for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); } printf("\n"); } #endif max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:7:5: error: 'index' redeclared as different kind of symbol 7 | int index[1001][1001][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s774242224
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> int map[1000][1000]; int index[1001][1001][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] =='*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } // for (i = 0; i < n; i++){ // for (j = 0; j < n; j++){ // printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); // } // printf("\n"); // } max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:7:5: error: 'index' redeclared as different kind of symbol 7 | int index[1001][1001][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s831789944
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> char map[1000][1000]; char index[1001][1001][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] =='*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } // for (i = 0; i < n; i++){ // for (j = 0; j < n; j++){ // printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); // } // printf("\n"); // } max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:7:6: error: 'index' redeclared as different kind of symbol 7 | char index[1001][1001][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s270727728
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> #define SIZE (100) int map[SIZE][SIZE]; int index[SIZE + 1][SIZE + 1][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] =='*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } // for (i = 0; i < n; i++){ // for (j = 0; j < n; j++){ // printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); // } // printf("\n"); // } max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:9:5: error: 'index' redeclared as different kind of symbol 9 | int index[SIZE + 1][SIZE + 1][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s205766806
p00092
C
// AOJ Volume 0 Problem 0092 #include <stdio.h> #include <string.h> #define SIZE (100) int map[SIZE][SIZE]; int index[SIZE + 1][SIZE + 1][2]; int main(void) { int n; char str[1001]; int i, j; int max; int s; while (1){ scanf("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf("%s", str); for (j = 0; str[j] != '\0'; j++){ if (str[j] == '*'){ map[i][j] = 0; } else { map[i][j] = 1; } } } memset(index, 0, sizeof(index)); for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (j == 0){ index[i][j][0] = map[i][j]; index[j][i][1] = map[j][i]; } else { index[i][j][0] = (index[i][j - 1][0] + map[i][j]) * map[i][j]; index[j][i][1] = (index[j - 1][i][1] + map[j][i]) * map[j][i]; } } } // for (i = 0; i < n; i++){ // for (j = 0; j < n; j++){ // printf("(%2d:%2d)", index[i][j][0], index[i][j][1]); // } // printf("\n"); // } max = 0; for (i = 0; i < n; i++){ for (j = 0; j < n; j++){ if (index[i][j][0] != 0 && index[i][j][1] != 0){ s = 2; while (index[i + s - 1][j + s - 1][0] >= s && index[i + s - 1][j + s - 1][1] >= s){ s++; } s--; if (s > max){ // printf("<%d, %d=%d>", j, i, s); max = s; } } } } printf("%d\n", max); } return (0); }
main.c:9:5: error: 'index' redeclared as different kind of symbol 9 | int index[SIZE + 1][SIZE + 1][2]; | ^~~~~ In file included from /usr/include/string.h:462, from main.c:4: /usr/include/strings.h:68:14: note: previous declaration of 'index' with type 'char *(const char *, int)' 68 | extern char *index (const char *__s, int __c) | ^~~~~
s456080409
p00092
C
z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) for(memset(a,m=0,4004);i--;t=a,a=b,b=t) for(j=scanf(" ");j++<n;) m=fmax(m,b[j]=getchar()-'*'?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0); } } }
main.c:1:1: warning: data definition has no type or storage class 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:30: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^ main.c:1:32: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^~~~ main.c: In function 'main': main.c:1:32: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:45: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) main.c:1:45: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^~~~~ main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:64: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) | ^~~~~~ main.c:1:64: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:64: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:64: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:2:13: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 2 | for(memset(a,m=0,4004);i--;t=a,a=b,b=t) | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) main.c:2:13: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 2 | for(memset(a,m=0,4004);i--;t=a,a=b,b=t) | ^~~~~~ main.c:2:13: note: include '<string.h>' or provide a declaration of 'memset' main.c:2:37: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 2 | for(memset(a,m=0,4004);i--;t=a,a=b,b=t) | ^ main.c:2:45: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 2 | for(memset(a,m=0,4004);i--;t=a,a=b,b=t) | ^ main.c:4:35: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 4 | m=fmax(m,b[j]=getchar()-'*'?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j,t;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m)) main.c:4:35: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 4 | m=fmax(m,b[j]=getchar()-'*'?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0); | ^~~~ main.c:4:35: note: include '<math.h>' or provide a declaration of 'fmax' main.c:4:47: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 4 | m=fmax(m,b[j]=getchar()-'*'?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0); | ^~~~~~~ main.c:4:47: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:4:63: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 4 | m=fmax(m,b[j]=getchar()-'*'?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0); | ^~~~ main.c:4:63: note: include '<math.h>' or provide a declaration of 'fmin' main.c:4:63: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:4:63: note: include '<math.h>' or provide a declaration of 'fmin' main.c: At top level: main.c:6:9: error: expected identifier or '(' before '}' token 6 | } | ^ main.c:7:1: error: expected identifier or '(' before '}' token 7 | } | ^
s069927633
p00092
C
z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:30: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c: In function 'main': main.c:1:30: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:62: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:62: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:83: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:83: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:83: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:106: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:114: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:146: error: expected ')' before ';' token 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ~ ^ | ) main.c:1:150: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:150: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:150: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:162: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~~ main.c:1:162: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:177: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[3001],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,2e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:177: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:177: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:177: note: include '<math.h>' or provide a declaration of 'fmin'
s623718190
p00092
C
z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:30: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c: In function 'main': main.c:1:30: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:62: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:62: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:83: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:83: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:83: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:107: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:115: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:147: error: expected ')' before ';' token 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ~ ^ | ) main.c:1:151: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:151: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:151: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:163: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~~ main.c:1:163: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:178: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+1001,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,4004);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;a[j]=0;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:178: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:178: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:178: note: include '<math.h>' or provide a declaration of 'fmin'
s262218264
p00092
C
z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:18: error: invalid operands to binary + (have 'int *' and 'double') 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ~^ | | | int * main.c:1:23: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:25: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:27: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:29: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c: In function 'main': main.c:1:29: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:42: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:42: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~ main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:61: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:61: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:82: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:82: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~ main.c:1:82: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:105: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:113: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^ main.c:1:142: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} main.c:1:142: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:142: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:154: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~~~~ main.c:1:154: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:169: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2e3,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=scanf(" ");j++<n;)m=fmax(m,b[j]=getchar()-42?1+fmin(fmin(b[j-1],a[j-1]),a[j]):0);} | ^~~~ main.c:1:169: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:169: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:169: note: include '<math.h>' or provide a declaration of 'fmin'
s655674013
p00092
C
*a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));}
main.c:1:1: warning: data definition has no type or storage class 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:2: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:4: error: 'z' undeclared here (not in a function) 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:16: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:18: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:20: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:22: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:29: error: return type defaults to 'int' [-Wimplicit-int] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c: In function 'main': main.c:1:29: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:42: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:42: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~ main.c:1:42: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:61: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:61: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:61: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:82: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:82: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:82: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:105: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:113: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:134: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:134: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:134: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:146: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~~ main.c:1:146: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:163: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | *a=z,*b=z+2000,m,i,j,z[999];main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:163: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:163: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:163: note: include '<math.h>' or provide a declaration of 'fmin'
s725589727
p00092
C
z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^ main.c:1:30: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c: In function 'main': main.c:1:30: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~ main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:62: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:62: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:83: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:83: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~ main.c:1:83: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:112: error: invalid operands to binary ^ (have 'int *' and 'int *') 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~ main.c:1:134: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} main.c:1:134: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:134: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:146: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~~~~ main.c:1:146: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:163: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;a^=b^=a^=b)for(j=0;j++<=n;)m=fmax(m,b[j]=getchar()-46?0:1+fmin(fmin(b[j-1],a[j-1]),a[j]));} | ^~~~ main.c:1:163: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:163: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:163: note: include '<math.h>' or provide a declaration of 'fmin'
s562656753
p00092
C
z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:30: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c: In function 'main': main.c:1:30: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~ main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:63: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~ main.c:1:63: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:63: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:63: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:95: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:103: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:121: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} main.c:1:121: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:121: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:137: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~~ main.c:1:137: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:152: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:152: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:152: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:152: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:182: error: expected ':' before ')' token 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=i<n&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ | :
s455423885
p00092
C
z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:30: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c: In function 'main': main.c:1:30: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:43: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} main.c:1:43: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~ main.c:1:43: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:62: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~ main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:62: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:83: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} main.c:1:83: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~ main.c:1:83: note: include '<string.h>' or provide a declaration of 'memset' main.c:1:106: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:114: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ main.c:1:134: error: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} main.c:1:134: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:134: note: include '<math.h>' or provide a declaration of 'fmax' main.c:1:146: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~~~~ main.c:1:146: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:161: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^~~~ main.c:1:161: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:161: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:1:161: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:191: error: expected ':' before ')' token 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;scanf("%d",&n),i=n;printf("%d\n",m))for(memset(a,m=0,8e3);i--;j=a,a=b,b=j)for(j=n+1;j--;)m=fmax(m,b[j]=getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j])):0;} | ^ | :
s214453105
p00092
C
z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:30: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:32: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~ main.c: In function 'main': main.c:1:32: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:46: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} main.c:1:46: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~~ main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:66: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~~~ main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:66: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:66: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:98: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:106: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ main.c:1:144: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~~~~ main.c:1:144: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:159: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} main.c:1:159: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^~~~ main.c:1:159: note: include '<math.h>' or provide a declaration of 'fmin' main.c:1:191: error: expected ';' before ')' token 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;!scanf("%d",&n)|n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ | ; main.c:1:191: error: expected statement before ')' token
s703973909
p00092
C
z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;}
main.c:1:1: warning: data definition has no type or storage class 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:24: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:26: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:28: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:30: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:32: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~ main.c: In function 'main': main.c:1:32: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:45: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} main.c:1:45: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~~ main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:67: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~~~ main.c:1:67: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:67: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:67: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:97: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:105: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:130: error: 'k' undeclared (first use in this function) 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^ main.c:1:130: note: each undeclared identifier is reported only once for each function it appears in main.c:1:143: error: implicit declaration of function 'getchar' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~~~~ main.c:1:143: note: 'getchar' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:1:158: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} main.c:1:158: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 1 | z[4000],*a=z,*b=z+2000,m,i,j,t;main(n){for(;scanf("%d",&n)*n++;m=!printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;t>m?m=t:0)k=b[j]=n+~i&&getchar()>45?1+fmin(a[j],fmin(b[j+1],a[j+1])):0;} | ^~~~ main.c:1:158: note: include '<math.h>' or provide a declaration of 'fmin'
s732771467
p00092
C
z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;}
main.c:1:1: warning: data definition has no type or storage class 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int] main.c:1:10: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:23: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:25: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:27: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:29: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:31: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:33: error: return type defaults to 'int' [-Wimplicit-int] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~ main.c: In function 'main': main.c:1:33: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:48: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} main.c:1:48: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~~ main.c:1:48: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:67: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~~~ main.c:1:67: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:67: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:67: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:97: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:105: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^ main.c:1:143: error: implicit declaration of function 'getch' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~~ main.c:1:154: error: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmin' +++ |+#include <math.h> 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} main.c:1:154: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] 1 | z[2002],*a=z,*b=z+999,j,m,k,t,i;main(n){for(;m=scanf("%d",&n)-++n;printf("%d\n",m))for(i=n;i--;j=a,a=b,b=j)for(j=n;j--;m<k?m=k:0)b[j]=k=n+~i&&getch()>45?fmin(t=a[j],t<k?t:k)+1:0;} | ^~~~ main.c:1:154: note: include '<math.h>' or provide a declaration of 'fmin'
s350688102
p00092
C
#include<iostream> using namespace std; int min(int,int); int main(void){ char dp[1001][1001]; int n,i,j,max,M[1001][1001]; while(cin >> n,n){ max=0; for(i=0;i<n;i++){ for(j=0;j<n;j++){ M[i][j]=1; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ cin >> dp[i][j]; if(i==0){ if(dp[i][j]!='*')M[i][j]=1; else M[i][j]=-1; } else{ if(dp[i][j]!='*'){ if(j==0)M[i][j]=1; else{ if(M[i-1][j]==-1 || M[i-1][j-1]==-1 || M[i][j-1]==-1) M[i][j]=1; else M[i][j]=min(M[i-1][j],min(M[i-1][j-1],M[i][j-1]))+1; } } } if(dp[i][j]=='*')M[i][j]=-1; } } for(i=0;i<n;i++){ for(j=0;j<n;j++){ if(M[i][j]>=0 && max<M[i][j])max=M[i][j]; } } cout << max <<"\n"; } return 0; } int min(int x,int y){ return x<y?x:y; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s733100333
p00092
C
#include<iostream> #include<algorithm> using namespace std; int main(void){ char dp[1001][1001]; int n,M[1001][1001]; while(cin >> n,n){ for(int i=0;i<n;i++) for(int j=0;j<n;j++) M[i][j]=1; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ cin >> dp[i][j]; if(i==0){ if(dp[i][j]!='*')M[i][j]=1; else M[i][j]=-1; } else{ if(dp[i][j]!='*'){ if(j==0)M[i][j]=1; else{ if(M[i-1][j]==-1 || M[i-1][j-1]==-1 || M[i][j-1]==-1)M[i][j]=1; else M[i][j]=min(M[i-1][j],min(M[i-1][j-1],M[i][j-1]))+1; } } } if(dp[i][j]=='*')M[i][j]=-1; } } int ans=0; for(int i=0;i<n;i++) for(int j=0;j<n;j++) ans=max(ans,M[i][j]); cout << ans << endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s123769808
p00092
C
#include<iostream> using namespace std; int main() { int n; for(;cin>>n,n;) { string s[n]; int ans=0; for(int i=0;i<n;i++) cin>>s[i]; for(int x=0;x<n;x++) for(int y=0;y<n;y++) { if(s[x][y]=='.') { int count = 1; for(int tmp=1;tmp<n;tmp++) { if(tmp+x>=n ||tmp+y>=n) break; bool c=true; for(int tt=0;tt<tmp+1;tt++) { if(s[x+tt][y+tmp]=='*' || s[x+tmp][y+tt]=='*') { c=false; break; } } if(c) count++; else break; } if(count>ans) ans=count; } } cout<<ans<<endl; } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s699483944
p00092
C
#include <stdio.h> #define MIN(a,b) ((a) < (b) ? (a) : (b)) int main(void){ char c[2]; int fr[1000][1000],n,i,j,x,ans; while(scanf("%d",&n)){ if(n==0)break; ans=0; for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%1s",&c); if(c[0]=='.'){ if(i==0 || j==0)fr[i][j]=1; else { x=MIN(MIN(fr[i][j-1],fr[i-1][j]),fr[i-1][j-1])+1; if(ans<x)ans=x; fr[i][j]=x; } } else fr[i][j]=0; } } printf("%d\n",ans); return 0; }
main.c: In function 'main': main.c:25:1: error: expected declaration or statement at end of input 25 | } | ^
s997184488
p00092
C++
#include<iostream> #include<algorithm> using namespace std; dp[1111][1111]; string s[1111]; main() { int n; while(cin>>n,n) { for(int i=0;i<n;i++)for(int j=0;j<n;j++)dp[i][j]=0; dp[0][0]=s[0][0]=='.'; for(int i=1;i<n;i++) { if(s[i][0]=='.')dp[i][0]=dp[i-1][0]+1; if(s[0][i]=='.')dp[0][i]=dp[0][i-1]+1; } for(int i=1;i<n;i++)for(int j=1;j<n;j++) { if(s[i][j]=='.')dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1; } int ans=0; for(int i=0;i<n;i++)for(int j=0;j<n;j++)ans=max(ans,dp[i][j]); cout<<ans<<endl; } }
a.cc:4:1: error: 'dp' does not name a type 4 | dp[1111][1111]; | ^~ a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~ a.cc: In function 'int main()': a.cc:11:49: error: 'dp' was not declared in this scope 11 | for(int i=0;i<n;i++)for(int j=0;j<n;j++)dp[i][j]=0; | ^~ a.cc:12:9: error: 'dp' was not declared in this scope 12 | dp[0][0]=s[0][0]=='.'; | ^~
s019105427
p00092
C++
while(1): n = int(input()) if n == 0: break a = [0 for i in range(n)] b = [[0 for i in range(n)] for j in range(n)] c_ = [[2000 for i in range(n)] for j in range(n)] c = [[0 for i in range(n)] for j in range(n)] for i in range(n): a[i] = [0 if i == "." else 1 for i in list(input())] for j in range(n): for k in range(j,n): if a[i][k] == 1: break b[i][j] = k-j+1 for col in range(n): for i in range(n): for j in range(i,n): min_ = min(c_[i][col], b[j][col]) if min_ < j-i+1: break c_[i][col] = min_ c[i][col] = j-i+1 print(max([max(i) for i in c]))
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while(1): | ^~~~~
s227662354
p00092
C++
#include<iostream> #include<string> #define NMAX 1010 int n; string sqs[NMAX]; int sqi[NMAX][NMAX]={0}; int c; int max; using namespace std; int main(){ int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int max; while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>sqs[i]; } for(int i=0;i<n;i++){ sqi[i][0]=1; c=2; for(int j=1;j<n;j++){ if(sqs[i][j]=='.') sqi[i][j]=c++; else sqi[i][j]=0,c=1; } } max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ /*(i,j) 左上*/ for(int k=0;i+k<n||j+k<n;k++){ if(k+1<=max) continue; /*(i+k,j+k) 右下*/ bool f=true; for(int l=0;l<=k&&f;l++){ if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; } if(f) max=k+1; else break; } } } cout<<max<<endl; } }
a.cc:7:5: error: 'string' does not name a type; did you mean 'stdin'? 7 | string sqs[NMAX]; | ^~~~~~ | stdin
s232862474
p00092
C++
#include<iostream> #include<string> #define NMAX 1010 int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int max; using namespace std; int main(){ int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int max; while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>sqs[i]; } for(int i=0;i<n;i++){ sqi[i][0]=1; c=2; for(int j=1;j<n;j++){ if(sqs[i][j]=='.') sqi[i][j]=c++; else sqi[i][j]=0,c=1; } } max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ /*(i,j) 左上*/ for(int k=0;i+k<n||j+k<n;k++){ if(k+1<=max) continue; /*(i+k,j+k) 右下*/ bool f=true; for(int l=0;l<=k&&f;l++){ if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; } if(f) max=k+1; else break; } } } cout<<max<<endl; } }
a.cc:7:1: error: 'string' does not name a type; did you mean 'stdin'? 7 | string sqs[NMAX]; | ^~~~~~ | stdin
s419984366
p00092
C++
#include<iostream> #include<string> #define NMAX 1010 int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int max; using namespace std; int main(){ while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>sqs[i]; } for(int i=0;i<n;i++){ sqi[i][0]=1; c=2; for(int j=1;j<n;j++){ if(sqs[i][j]=='.') sqi[i][j]=c++; else sqi[i][j]=0,c=1; } } max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ /*(i,j) 左上*/ for(int k=0;i+k<n||j+k<n;k++){ if(k+1<=max) continue; /*(i+k,j+k) 右下*/ bool f=true; for(int l=0;l<=k&&f;l++){ if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; } if(f) max=k+1; else break; } } } cout<<max<<endl; } }
a.cc:7:1: error: 'string' does not name a type; did you mean 'stdin'? 7 | string sqs[NMAX]; | ^~~~~~ | stdin a.cc: In function 'int main()': a.cc:22:18: error: 'sqs' was not declared in this scope; did you mean 'sqi'? 22 | cin>>sqs[i]; | ^~~ | sqi a.cc:29:18: error: 'sqs' was not declared in this scope; did you mean 'sqi'? 29 | if(sqs[i][j]=='.') sqi[i][j]=c++; | ^~~ | sqi a.cc:34:9: error: reference to 'max' is ambiguous 34 | max=0; | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:10:5: note: 'int max' 10 | int max; | ^~~ a.cc:40:23: error: reference to 'max' is ambiguous 40 | if(k+1<=max) continue; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:10:5: note: 'int max' 10 | int max; | ^~~ a.cc:44:20: error: 'sqs' was not declared in this scope; did you mean 'sqi'? 44 | if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; | ^~~ | sqi a.cc:46:21: error: reference to 'max' is ambiguous 46 | if(f) max=k+1; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:10:5: note: 'int max' 10 | int max; | ^~~ a.cc:51:15: error: reference to 'max' is ambiguous 51 | cout<<max<<endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:10:5: note: 'int max' 10 | int max; | ^~~
s792417416
p00092
C++
#include<iostream> #include<string> #define NMAX 1010 using namespace std; int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int max; int main(){ while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>sqs[i]; } for(int i=0;i<n;i++){ sqi[i][0]=1; c=2; for(int j=1;j<n;j++){ if(sqs[i][j]=='.') sqi[i][j]=c++; else sqi[i][j]=0,c=1; } } max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ /*(i,j) 左上*/ for(int k=0;i+k<n||j+k<n;k++){ if(k+1<=max) continue; /*(i+k,j+k) 右下*/ bool f=true; for(int l=0;l<=k&&f;l++){ if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; } if(f) max=k+1; else break; } } } cout<<max<<endl; } }
a.cc: In function 'int main()': a.cc:35:9: error: reference to 'max' is ambiguous 35 | max=0; | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:12:5: note: 'int max' 12 | int max; | ^~~ a.cc:41:23: error: reference to 'max' is ambiguous 41 | if(k+1<=max) continue; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:12:5: note: 'int max' 12 | int max; | ^~~ a.cc:47:21: error: reference to 'max' is ambiguous 47 | if(f) max=k+1; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:12:5: note: 'int max' 12 | int max; | ^~~ a.cc:52:15: error: reference to 'max' is ambiguous 52 | cout<<max<<endl; | ^~~ /usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)' 303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp) | ^~~ /usr/include/c++/14/bits/stl_algobase.h:257:5: note: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)' 257 | max(const _Tp& __a, const _Tp& __b) | ^~~ a.cc:12:5: note: 'int max' 12 | int max; | ^~~
s450681862
p00092
C++
#include<iostream> #include<string> #define NMAX 1010 using namespace std; int n; string sqs[NMAX]; int sqi[NMAX][NMAX]; int c; int main(){ while(1){ cin>>n; if(n==0) break; for(int i=0;i<n;i++){ cin>>sqs[i]; } for(int i=0;i<n;i++){ sqi[i][0]=1; c=2; for(int j=1;j<n;j++){ if(sqs[i][j]=='.') sqi[i][j]=c++; else sqi[i][j]=0,c=1; } } max=0; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ /*(i,j) 左上*/ for(int k=0;i+k<n||j+k<n;k++){ if(k+1<=max) continue; /*(i+k,j+k) 右下*/ bool f=true; for(int l=0;l<=k&&f;l++){ if(sqs[i+l][j]=='*'||sqs[i+l][j+k]=='*'||sqi[i+l][j]+k!=sqi[i+l][j+k]) f=false; } if(f) max=k+1; else break; } } } cout<<max<<endl; } }
a.cc: In function 'int main()': a.cc:33:13: error: overloaded function with no contextual type information 33 | max=0; | ^ a.cc:39:21: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<=' 39 | if(k+1<=max) continue; | ~~~^~~~~ a.cc:45:27: error: overloaded function with no contextual type information 45 | if(f) max=k+1; | ^ a.cc:50:13: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 50 | cout<<max<<endl; | ~~~~^~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<
s677297000
p00092
C++
10 ...*....** .......... **....**.. ........*. ..*....... .......... .*........ .......... ....*..*** .*....*... 10 ****.***** *..*.*.... ****.*.... *....*.... *....***** .......... ****.***** *..*...*.. ****...*.. *..*...*.. 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 10 | ^~
s405469202
p00092
C++
#include <iostream> #include <cstdio> using namespace std; #define MAX(A, B) ((A) > (B)? (A): (B)) #define MIN(A, B) ((A) < (B)? (A): (B)) int search(int x, int y, int pat); int n; bool tront[1000][1000]; int table[1000][1000]; int main() { int i, j; while (1) { int max = 0; memset(table, 0, sizeof(table)); cin >> n; getchar(); if (n == 0) break; for (i = 0; i < n; i++) { char str[1001]; gets(str); for (j = 0; j < n; j++) { switch (str[j]) { case '.': tront[i][j] = 0; break; case '*': tront[i][j] = 1; break; } } } for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (!tront[i][j]) { int kmax = search(i, j, 0); max = MAX(max, kmax); } } } cout << max << endl; } return 0; } int search(int x, int y, int pat) { int cx = 1, cy = 1, cxy = 1; if (table[x][y]) return table[x][y]; if (x >= n || y >= n || tront[x][y]) return 0; switch (pat) { case 0: cx += search(x+1, y, 1); cy += search(x, y+1, 2); cxy += search(x+1, y+1, 0); table[x][y] = MIN(cx, MIN(cy, cxy)); return table[x][y]; break; case 1: cx += search(x+1, y, 1); return cx; break; case 2: cy += search(x, y+1, 2); return cy; break; } }
a.cc: In function 'int main()': a.cc:18:17: error: 'memset' was not declared in this scope 18 | memset(table, 0, sizeof(table)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <cstdio> +++ |+#include <cstring> 3 | using namespace std; a.cc:25:25: error: 'gets' was not declared in this scope; did you mean 'getw'? 25 | gets(str); | ^~~~ | getw a.cc: In function 'int search(int, int, int)': a.cc:75:1: warning: control reaches end of non-void function [-Wreturn-type] 75 | } | ^
s326879074
p00092
C++
#include<bits/stdc++.h> using namespace std; string str[1000]; int serch(int now,int y,int x,char s,int maxe) { if(maxe==now+x)return 0; for(int i=0;;i++){ if(str[y+i][x+now]!=s||str[y+now][x+i]!=s)return 0; if(y+i==y+now)break; } return serch(now+1,y,x,s)+1; } int main() { int n; while(cin>>n,n){ for(int i=0;i<n;i++)cin>>str[i]; int ans=1; for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(str[i][j]=='.'){ int kawa=1+serch(1,i,j,'.',n); if(kawa>ans)ans=kawa; } } } cout<<ans<<endl; } }
a.cc: In function 'int serch(int, int, int, char, int)': a.cc:11:17: error: too few arguments to function 'int serch(int, int, int, char, int)' 11 | return serch(now+1,y,x,s)+1; | ~~~~~^~~~~~~~~~~~~ a.cc:4:5: note: declared here 4 | int serch(int now,int y,int x,char s,int maxe) | ^~~~~
s121055405
p00092
C++
#include <stdio.h> #include <queue> using namespace std; int main() { queue<int> x,y,longth; int n,memlongth,ans; int dx1[9] = {-1,-1,-1,0,0,0,1,1,1},dy1[9] = {-1,0,1,-1,0,1,-1,0,1},dx2[3] = {1,0,1},dx2[3] = {0,1,1}; while(1) { char field[1010][1010] = {0},N; scanf("%d",&n); if(n == 0)return 0; scanf("%c",&N); for(int i = 0; i < n; i++) { for(int j = 0; j < n + 1; j++) { scanf("%c",&field[j][i]); if(field[j][i] == '*') { x.push(j); y.push(i); longth.push(0); } } } for(int i = 0; i < n; i++) { for(int j = 0; j < n + 1; j++) { if(field[j][i] == '.' && (i == 0 || i == n - 1 || j == 0 || j == n - 1)) { field[j][i] = '1'; x.push(j); y.push(i); longth.push(1); } } } while(x.size()) { for(int i = 0; i < 9; i++) { if(0 <= x.front() + dx1[i] && x.front() + dx1[i] < n && 0 <= y.front() + dy1[i] && y.front() + dy1[i] < n && field[x.front() + dx1[i]][y.front() + dy1[i]] == '.') { field[x.front() + dx1[i]][y.front() + dy1[i]] = longth.front() + 1 + '0'; x.push(x.front() + dx1[i]); y.push(y.front() + dy1[i]); longth.push(longth.front() + 1); memlongth = longth.front() + 1; /*for(int i = 0; i < n; i++) { for(int j = 0; j < n + 1; j++) { printf("%c",field[j][i]); } } printf("\n");*/ } } x.pop(); y.pop(); longth.pop(); } ans = longth * 2 - 1; for(int i = 0; i < n - 1; i++) { for(int j = 0; j < n - 1; j++) { if(field[j][i] - '0' == memlongth) { for(int k = 0; k < 3; k++) { if(field[j + dx2[k]][i + dy2[k]] = memlongth); else bleak; if(k == 2)ans = longth * 2; } } } } printf("%d\n",ans); } }
a.cc: In function 'int main()': a.cc:10:90: error: redeclaration of 'int dx2 [3]' 10 | int dx1[9] = {-1,-1,-1,0,0,0,1,1,1},dy1[9] = {-1,0,1,-1,0,1,-1,0,1},dx2[3] = {1,0,1},dx2[3] = {0,1,1}; | ^~~ a.cc:10:73: note: 'int dx2 [3]' previously declared here 10 | int dx1[9] = {-1,-1,-1,0,0,0,1,1,1},dy1[9] = {-1,0,1,-1,0,1,-1,0,1},dx2[3] = {1,0,1},dx2[3] = {0,1,1}; | ^~~ a.cc:70:22: error: no match for 'operator*' (operand types are 'std::queue<int>' and 'int') 70 | ans = longth * 2 - 1; | ~~~~~~ ^ ~ | | | | | int | std::queue<int> a.cc:79:50: error: 'dy2' was not declared in this scope; did you mean 'dx2'? 79 | if(field[j + dx2[k]][i + dy2[k]] = memlongth); | ^~~ | dx2 a.cc:80:30: error: 'bleak' was not declared in this scope 80 | else bleak; | ^~~~~ a.cc:81:48: error: no match for 'operator*' (operand types are 'std::queue<int>' and 'int') 81 | if(k == 2)ans = longth * 2; | ~~~~~~ ^ ~ | | | | | int | std::queue<int>
s671599292
p00092
C++
#include <stdio.h> #include <algorithm> #include <iostream> #include <stdlib.h> #define rep(i, n) for(int i=0;i<n;i++) #define FOR(i, j, n) for(int i=j;i<n;i++) int N; // char** data; char data[50][50]; // int** dp; int dp[50][50]; int search() { int max = 0; FOR(i, 1, N) { FOR(j, 1, N) { int k = i; int l = j; int up = 0, left = 0; int previous = dp[i - 1][j - 1] + 1; while(k >= 0 && data[k][j] == '.') { ++up; --k; } while(l >= 0 && data[i][l] == '.') { ++left; --l; } dp[i][j] = std::min({up, left, previous}); max = dp[i][j] > max ? dp[i][j] : max; } } return max; } int main() { while(1) { std::cin >> N; if (N == 0) return 0; memset(dp, 0, sizeof(dp)); // data = (char**)malloc(sizeof(char*) * N); // dp = (int**)malloc(sizeof(int*) * N); rep(i, N) { // data[i] = (char*)malloc(sizeof(char) * N); // dp[i] = (int*)malloc(sizeof(int) * N); rep(j, N) std::cin >> data[i][j]; dp[i][0] = data[i][0] == '.' ? 1 : 0; dp[0][i] = data[0][i] == '.' ? 1 : 0; } int max = search(); std::cout << max << std::endl; // rep(i, N) { // free(dp[i]); // free(data[i]); // } // free(data); // free(dp); } return 0; }
a.cc: In function 'int main()': a.cc:43:9: error: 'memset' was not declared in this scope 43 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <stdlib.h> +++ |+#include <cstring> 5 | #define rep(i, n) for(int i=0;i<n;i++)
s861037119
p00092
C++
#include <stdio.h> #include <algorithm> #include <iostream> #include <stdlib.h> #define rep(i, n) for(int i=0;i<n;i++) #define FOR(i, j, n) for(int i=j;i<n;i++) int N; char data[50][50]; int dp[50][50]; int search() { int max = 0; FOR(i, 1, N) { FOR(j, 1, N) { int k = i; int l = j; int up = 0, left = 0; int previous = dp[i - 1][j - 1] + 1; while(k >= 0 && data[k][j] == '.') { ++up; --k; } while(l >= 0 && data[i][l] == '.') { ++left; --l; } dp[i][j] = std::min({up, left, previous}); max = dp[i][j] > max ? dp[i][j] : max; } } return max; } int main() { while(1) { std::cin >> N; if (N == 0) return 0; memset(dp, 0, sizeof(dp)); memset(data, 0, sizeof(data)); rep(i, N) { rep(j, N) std::cin >> data[i][j]; dp[i][0] = data[i][0] == '.' ? 1 : 0; dp[0][i] = data[0][i] == '.' ? 1 : 0; } std::cout << search() << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:41:9: error: 'memset' was not declared in this scope 41 | memset(dp, 0, sizeof(dp)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <stdlib.h> +++ |+#include <cstring> 5 | #define rep(i, n) for(int i=0;i<n;i++)
s209351777
p00092
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 #include<stdio.h> #include<algorithm> using namespace std; int main() { int n,ans = 0; int dp[1100][1100]; char field; while(scanf("%d",&n),n) { for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) { scanf(" %c",&field); dp[j + 1][i + 1] = 0; if(field == '*')dp[j + 1][i + 1] = -1; } for(int i = 1; i < n + 1; i++) { for(int j = 1; j < n + 1; j++) { if(dp[j][i] == -1); else if(j == 1 || i == 1)dp[j][i] = 1; else dp[j][i] = max(1,min(dp[j - 1][i - 1],min(dp[j - 1][i],dp[j][i - 1])) + 1); ans = max(ans,dp[j][i]); } } /*for(int i = 1; i < n + 1; i++) { for(int j = 1; j < n + 1; j++) { printf("%2d",dp[j][i]); } printf("\n"); }*/ printf("%d\n",ans); ans = 0; } return 0; }
a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 1 | ^ In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/bits/stl_algo.h:71, from /usr/include/c++/14/algorithm:61, from a.cc:43: /usr/include/stdlib.h:98:8: error: 'size_t' does not name a type 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:42:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 41 | # include <bits/waitstatus.h> +++ |+#include <cstddef> 42 | /usr/include/stdlib.h:278:36: error: 'size_t' has not been declared 278 | extern int strfromd (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:282:36: error: 'size_t' has not been declared 282 | extern int strfromf (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:286:36: error: 'size_t' has not been declared 286 | extern int strfroml (char *__dest, size_t __size, const char *__format, | ^~~~~~ /usr/include/stdlib.h:298:38: error: 'size_t' has not been declared 298 | extern int strfromf32 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:304:38: error: 'size_t' has not been declared 304 | extern int strfromf64 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:310:39: error: 'size_t' has not been declared 310 | extern int strfromf128 (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:316:39: error: 'size_t' has not been declared 316 | extern int strfromf32x (char *__dest, size_t __size, const char * __format, | ^~~~~~ /usr/include/stdlib.h:322:39: error: 'size_t' has not been declared 322 | extern int strfromf64x (char *__dest, size_t __size, const char * __format, | ^~~~~~ In file included from /usr/include/stdlib.h:514: /usr/include/x86_64-linux-gnu/sys/types.h:33:9: error: '__u_char' does not name a type 33 | typedef __u_char u_char; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:34:9: error: '__u_short' does not name a type 34 | typedef __u_short u_short; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:35:9: error: '__u_int' does not name a type 35 | typedef __u_int u_int; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:36:9: error: '__u_long' does not name a type 36 | typedef __u_long u_long; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:37:9: error: '__quad_t' does not name a type 37 | typedef __quad_t quad_t; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:38:9: error: '__u_quad_t' does not name a type 38 | typedef __u_quad_t u_quad_t; | ^~~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:39:9: error: '__fsid_t' does not name a type 39 | typedef __fsid_t fsid_t; | ^~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:42:9: error: '__loff_t' does not name a type; did you mean '__locale_t'? 42 | typedef __loff_t loff_t; | ^~~~~~~~ | __locale_t /usr/include/x86_64-linux-gnu/sys/types.h:47:9: error: '__ino_t' does not name a type 47 | typedef __ino_t ino_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:54:9: error: '__ino64_t' does not name a type 54 | typedef __ino64_t ino64_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:59:9: error: '__dev_t' does not name a type 59 | typedef __dev_t dev_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:64:9: error: '__gid_t' does not name a type 64 | typedef __gid_t gid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:69:9: error: '__mode_t' does not name a type; did you mean '__locale_t'? 69 | typedef __mode_t mode_t; | ^~~~~~~~ | __locale_t /usr/include/x86_64-linux-gnu/sys/types.h:74:9: error: '__nlink_t' does not name a type 74 | typedef __nlink_t nlink_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:79:9: error: '__uid_t' does not name a type 79 | typedef __uid_t uid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:97:9: error: '__pid_t' does not name a type 97 | typedef __pid_t pid_t; | ^~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:103:9: error: '__id_t' does not name a type 103 | typedef __id_t id_t; | ^~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:114:9: error: '__daddr_t' does not name a type 114 | typedef __daddr_t daddr_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:115:9: error: '__caddr_t' does not name a type 115 | typedef __caddr_t caddr_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:121:9: error: '__key_t' does not name a type 121 | typedef __key_t key_t; | ^~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:126: /usr/include/x86_64-linux-gnu/bits/types/clock_t.h:7:9: error: '__clock_t' does not name a type 7 | typedef __clock_t clock_t; | ^~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:128: /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h:7:9: error: '__clockid_t' does not name a type 7 | typedef __clockid_t clockid_t; | ^~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:129: /usr/include/x86_64-linux-gnu/bits/types/time_t.h:10:9: error: '__time_t' does not name a type 10 | typedef __time_t time_t; | ^~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:130: /usr/include/x86_64-linux-gnu/bits/types/timer_t.h:7:9: error: '__timer_t' does not name a type 7 | typedef __timer_t timer_t; | ^~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:134:9: error: '__useconds_t' does not name a type 134 | typedef __useconds_t useconds_t; | ^~~~~~~~~~~~ /usr/include/x86_64-linux-gnu/sys/types.h:138:9: error: '__suseconds_t' does not name a type 138 | typedef __suseconds_t suseconds_t; | ^~~~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155: /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:24:9: error: '__int8_t' does not name a type; did you mean '__int128_t'? 24 | typedef __int8_t int8_t; | ^~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:25:9: error: '__int16_t' does not name a type; did you mean '__int128_t'? 25 | typedef __int16_t int16_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:26:9: error: '__int32_t' does not name a type; did you mean '__int128_t'? 26 | typedef __int32_t int32_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/bits/stdint-intn.h:27:9: error: '__int64_t' does not name a type; did you mean '__int128_t'? 27 | typedef __int64_t int64_t; | ^~~~~~~~~ | __int128_t /usr/include/x86_64-linux-gnu/sys/types.h:158:9: error: '__uint8_t' does not name a type; did you mean '__uint128_t'? 158 | typedef __uint8_t u_int8_t; | ^~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:159:9: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 159 | typedef __uint16_t u_int16_t; | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:160:9: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 160 | typedef __uint32_t u_int32_t; | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/sys/types.h:161:9: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 161 | typedef __uint64_t u_int64_t; | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/endian.h:35, from /usr/include/x86_64-linux-gnu/sys/types.h:176: /usr/include/x86_64-linux-gnu/bits/byteswap.h:33:17: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 33 | static __inline __uint16_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/byteswap.h:48:17: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 48 | static __inline __uint32_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/byteswap.h:69:31: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 69 | __extension__ static __inline __uint64_t | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/endian.h:36: /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:32:17: error: '__uint16_t' does not name a type; did you mean '__uint128_t'? 32 | static __inline __uint16_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:38:17: error: '__uint32_t' does not name a type; did you mean '__uint128_t'? 38 | static __inline __uint32_t | ^~~~~~~~~~ | __uint128_t /usr/include/x86_64-linux-gnu/bits/uintn-identity.h:44:17: error: '__uint64_t' does not name a type; did you mean '__uint128_t'? 44 | static __inline __uint64_t | ^~~~~~~~~~ | __uint128_t In file included from /usr/include/x86_64-linux-gnu/sys/select.h:37, from /usr/include/x86_64-linux-gnu/sys/types.h:179: /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h:14:3: error: '__time_t' does not name a type; did you mean '__sigset_t'? 14 | __time_t tv_sec; /* Seconds. */ |
s399084541
p00092
C++
z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;!scanf("%d",&n)||n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);}
a.cc:1:1: error: 'z' does not name a type 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;!scanf("%d",&n)||n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^ a.cc:1:34: error: expected constructor, destructor, or type conversion before '(' token 1 | z[4000],*a=z,*b=z+2000,m,i,j;main(n){for(;!scanf("%d",&n)||n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;)m=fmax(m,b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0);} | ^
s497753005
p00092
C++
z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0;}
a.cc:1:1: error: 'z' does not name a type 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0;} | ^ a.cc:1:36: error: expected constructor, destructor, or type conversion before '(' token 1 | z[4000],*a=z,*b=z+2000,m,i,j,k;main(n){for(;scanf("%d",&n),n;m=!printf("%d\n",m))for(i=++n;i--;j=a,a=b,b=j)for(j=n;j--;k>m?m=k:0)k=b[j]=n+~i&&getchar()>45?1+fmin(fmin(b[j+1],a[j+1]),a[j]):0;} | ^
s263339819
p00092
C++
#include <cstdio> #include <algorithm> #include <cstring> using namespace std; int n; char str[1005][1005]; int rui[1001][1001]; int main(){ while(1){ scanf("%d",&n); if(!n) break; for(int i=1;i<=n;i++){ scanf("%s",&str[i]); } for(int j=1;j<=n;j++){ for(int i=n-1;i>=0;i--){ str[j][i+1]=str[j][i]; } } memset(rui,0,sizeof(rui)); for(int i=1;i<=n;i++){ if(str[i][1]=='*'){ rui[i][1]=rui[i-1][1]+1; }else{ rui[i][1]=rui[i-1][1]; } } for(int i=1;i<=n;i++){ if(str[1][i]=='*'){ rui[1][i]=rui[1][i-1]+1; }else{ rui[1][i]=rui[1][i-1]; } } for(int i=2;i<=n;i++){ for(int j=2;j<=n;j++){ if(str[i][j]=='*'){ rui[i][j]=rui[i-1][j]+rui[i][j-1]-rui[i-1][j-1]+1; }else{ rui[i][j]=rui[i-1][j]+rui[i][j-1]-rui[i-1][j-1]; } } } int ans=1; for(int i=1;i<=n;i++){ for(int j=i;j<=n;j++){ if(j-i+1<=ans) continue; for(int k=1;k<=n-(j-i);k++){ int eo=rui[j][k+j-i]-rui[j][k-1]-rui[i-1][k+j-i]+rui[i-1][k-1]; if(!eo){ ans=max(ans,(j-i+1)); break; } } } } printf("%d\n",ans); }
a.cc: In function 'int main()': a.cc:58:2: error: expected '}' at end of input 58 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s093672077
p00092
C++
#include <cstdio> #include <cstring> #include <algorithm> using namespace std; int n; char str[1005][1005]; int rui[1001][1001]={}; int main(){ while(1){ scanf("%d",&n); if(!n) break; memset(rui,0,sizeof(rui)); for(int i=1;i<=n;i++){ scanf("%s",&str[i]); } for(int j=1;j<=n;j++){ for(int i=n-1;i>=0;i--){ str[j][i+1]=str[j][i]; } } for(int i=1;i<=n;i++){ if(str[i][1]=='*'){ rui[i][1]=rui[i-1][1]+1; }else{ rui[i][1]=rui[i-1][1]; } } for(int i=1;i<=n;i++){ if(str[1][i]=='*'){ rui[1][i]=rui[1][i-1]+1; }else{ rui[1][i]=rui[1][i-1]; } } for(int i=2;i<=n;i++){ for(int j=2;j<=n;j++){ if(str[i][j]=='*'){ rui[i][j]=rui[i-1][j]+rui[i][j-1]-rui[i-1][j-1]+1; }else{ rui[i][j]=rui[i-1][j]+rui[i][j-1]-rui[i-1][j-1]; } } } int ans=1; for(int i=1;i<=n;i++){ for(int j=i;j<=n;j++){ if(j-i+1<=ans) continue; for(int k=1;k<=n-(j-i);k++){ int eo=rui[j][k+j-i]-rui[j][k-1]-rui[i-1][k+j-i]+rui[i-1][k-1]; if(!eo){ ans=max(ans,(j-i+1)); break; } } } } printf("%d\n",ans); }
a.cc: In function 'int main()': a.cc:58:2: error: expected '}' at end of input 58 | } | ^ a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s152453589
p00092
C++
#include <iostream> #include <stdio.h> using namespace std; int main() { char c[1001]; int d[2][1002],i,j,k,n,m,mx; while(true) { cin >> n; k=0; mx=0; if (n==0) break; memset(d,0,sizeof(d)); for (i=0;i<n;i++) { cin >> c; for (j=0;j<n;j++) { if (c[j]=='.') { m=min(d[k][j],d[k][j+1]); m=min(m,d[1-k][j])+1; d[1-k][j+1]=m; mx=max(mx,m); } else d[1-k][j+1]=0; } k=1-k; } cout << mx << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: 'memset' was not declared in this scope 10 | memset(d,0,sizeof(d)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> 2 | #include <stdio.h>
s316399441
p00092
C++
#Include <iostream> using namespace std; int main () { int i,j,n; int dp[1001][1001]; int ma; char c; cin >> n; while(n != 0) { ma = 0; for(i=0; i<n; i++){ dp[0][i] = 0; } for(i=0; i<n; i++){ dp[i][0] = 0; } for(int i=1; i<=n; i++){ for(int j=1; j<=n; j++) { cin >> c; if(c == '*') { dp[j][i] = 0; continue; } dp[j][i] = min(dp[j-1][i], min(dp[j-1][i-1], dp[j][i-1]))+1; ma = (dp[j][i] > ma) ? dp[j][i] : ma; } } printf("%d\n", ma); cin >> n; } return 0; }
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include? 1 | #Include <iostream> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:11:3: error: 'cin' was not declared in this scope 11 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | #Include <iostream> a.cc:26:36: error: 'min' was not declared in this scope; did you mean 'main'? 26 | dp[j][i] = min(dp[j-1][i], min(dp[j-1][i-1], dp[j][i-1]))+1; | ^~~ | main a.cc:26:20: error: 'min' was not declared in this scope; did you mean 'main'? 26 | dp[j][i] = min(dp[j-1][i], min(dp[j-1][i-1], dp[j][i-1]))+1; | ^~~ | main a.cc:30:5: error: 'printf' was not declared in this scope 30 | printf("%d\n", ma); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | #Include <iostream>
s401534165
p00092
C++
#include<iostream> using namespace std; #define N 1000 #define max((a),(b)) ((a)>(b)?(a):(b)) #define min((a),(b)) ((a)>(b)?(b):(a)) int main() { char map[N][N]; int l[N][N], ans, n, dp[N][N], c; while(1) { cin >> n; if(!n) break; c = 0; for(int i=0; i<n; ++i) { for(int j=0; j<n; ++j) { cin >> map[i][j]; l[i][j] = 0; if(map[i][j]=='*') { c++; if(i) { int k = 1; while(map[i-k][j]!='*') { l[i-k][j] = k; if(i<(++k)) break; } } } } } for(int j=0; j<n; ++j) { int k = 1; while(map[n-k][j]!='*') { l[n-k][j] = k; if(n<(++k)) break; } } if(c==n*n) { cout << "0" << endl; continue; } ans = 1; for(int i=0; i<n; ++i) { for(int j=0; j<n; ++j) dp[j][j] = l[i][j]; int r = 0; for(int l=0; l<n; ++l) { if(r<l) r = l; while(dp[l][r]>(r-l+1)&&r<n-1) { r++; for(int m=l; m<r; ++m) { dp[m][r] = min(dp[m][r-1], dp[r][r]); } } ans = max(ans, min(dp[l][r], r-l+1)); } } cout << ans << endl; } return 0; }
a.cc:6:13: error: expected parameter name, found "(" 6 | #define max((a),(b)) ((a)>(b)?(a):(b)) | ^ a.cc:7:13: error: expected parameter name, found "(" 7 | #define min((a),(b)) ((a)>(b)?(b):(a)) | ^
s641246071
p00093
Java
package benkyo; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class BenkyoMain { public static void main(String args[] ) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); String output = ""; List<String> input = new ArrayList<String>(); while (line != null) { // CTRL+Z??§??\???????????? input.add(line); line = br.readLine(); } for (String inputLine : input) { String[] inputData = inputLine.split(" "); int startYear = Integer.parseInt(inputData[0]); int endYear = Integer.parseInt(inputData[1]); if (startYear == 0 && endYear == 0) { break; } boolean isEmpty = true; for (int i = startYear; i <= endYear; i++) { if (i % 4 == 0) { System.out.println(i); isEmpty = false; } } if (isEmpty) { System.out.println("NA"); } System.out.println(); } } }
Main.java:8: error: class BenkyoMain is public, should be declared in a file named BenkyoMain.java public class BenkyoMain { ^ 1 error
s382304904
p00093
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class AOJ_0093 { public static void main(String[] args) throws IOException { BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); ; while (input.ready()) { String[] inputStr = input.readLine().split(" "); if (inputStr[0].equals("0") && inputStr[1].equals("0")) { break; } ArrayList<Integer> ansList = leapYearCount(Integer.parseInt(inputStr[0]), Integer.parseInt(inputStr[1])); if (ansList.size() == 0) { System.out.println("NA"); System.out.println(); continue; } for (Integer each : ansList) { System.out.println(each); } System.out.println(); } } private static ArrayList<Integer> leapYearCount(int fromYear, int toYear) { ArrayList<Integer> yearList = new ArrayList<>(); for (int i = fromYear; i <= toYear; i++) { if (isLeapYear(i)) { yearList.add(i); } } return yearList; } private static boolean isLeapYear(int year) { if (year % 4 != 0) { return false; } if (year % 100 == 0 && year % 400 == 0) { return true; } if (year % 100 == 0) { return false; } return true; } }
Main.java:6: error: class AOJ_0093 is public, should be declared in a file named AOJ_0093.java public class AOJ_0093 ^ 1 error
s586462149
p00093
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (true) { int a = sc.nextInt(); int b = sc.nextInt(); if (a == 0 && b == 0) { break; } hasLeapYear(a, b); } sc.close(); } private static void hasLeapYear(int a, int b) { boolean hasLeapYear = false; for (int i = a; i <= b; i++) { boolean res = isLeapYear(i); if (res) { if (hasLeapYear == false) { hasLeapYear = true; } System.out.println(i); } } if (hasLeapYear == false) { System.out.println("NA"); } } private static boolean isLeapYear(int i) { if (i % 4 == 0) { if (i % 100 == 0) { if (i % 400 == 0) { return true; } else { return false; } } return true; } else { return false; } } }
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s069383733
p00093
Java
import java.util.Scanner; public class m_0093 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a,b,flag=0; while(true) { a=sc.nextInt(); b=sc.nextInt(); if ( a == 0 && b == 0 )break; while ( a < b ) { if ( a % 4 == 0 && a % 100 != 0 || a % 400 == 0 ) { System.out.println(a); flag=1; } a++; } if ( flag == 0 ) System.out.println("NA"); } } }
Main.java:2: error: class m_0093 is public, should be declared in a file named m_0093.java public class m_0093 { ^ 1 error
s152843894
p00093
Java
// 作成日 : 2012/11/02 // 作成者 : 01 石川力太 package 電話番号管理3; import java.io.*; import java.sql.*; public class Member3 { // Oracle DB 操作用のクラスをインスタンス化 OracleManager olm; BufferedReader br; ResultSet rs; public Member3 () throws IOException, SQLException { olm = new OracleManager(); //DB操作? br = new BufferedReader(new InputStreamReader(System.in)); // データ選択用のSQLを作成 // ;はSQLでは付けない // 検索した結果が ResultSet型のrsに保存される menu(); } // メニュー public void menu() throws IOException, SQLException { int command = 0; // 使いたい機能の番号 System.out.println("*** 電話番号管理1プログラム START ***\n"); do { System.out.println("1:登録 2:表示 3:検索 4:削除 0.終了"); System.out.print("番号を入力してください > "); command = Integer.parseInt(br.readLine()); if (command == 1) registData(); else if (command == 2) dataList(); else if (command == 3) searchData(); else if (command == 4) deleteData(); else if (command == 0) System.out.println("プログラムを終了します"); else System.out.println("正しい番号を入力してください"); if (command != 0) System.out.println(); } while (command != 0); } // 登録 public void registData () throws IOException { System.out.println("Oracle DB にデータを登録します。"); String name,tel; int mail; try{ System.out.print("氏名は?"); name = br.readLine(); System.out.println(); System.out.print("電話番号は?"); tel = br.readLine(); System.out.println(); System.out.print("メールは?(あり:1 なし:2)"); mail = Integer.parseInt(br.readLine()); System.out.println(); // Oracle DB 操作準備 olm.openResouce(); //DB操作? //DB操作? // データ登録用のSQLを作成 //;はSQLでは付けない olm.updateData("INSERT INTO DB1電話番号表 VALUES((SELECT (MAX(管理番号) + 1) FROM DB1電話番号表),'" + name + "','" + tel + "'," + mail + ")"); // Oracle DB 操作終了 olm.closeResouce(); //DB操作? System.out.println("正常に登録されました。"); }catch(IOException e){ System.out.println("コマンド入力中に入出力エラー発生!"); } catch(Exception e){ System.out.println(e.getMessage()); } } // 表示 public void dataList() { // Oracle DB 操作準備 olm.openResouce(); //DB操作? rs = olm.getData("SELECT 管理番号,氏名,電話番号,メール FROM DB1電話番号表 ORDER BY 管理番号"); //DB操作? // データ表示 処理 /* getIntは数値型データの取得 * getStringは文字型のデータの取得 */ try { while(rs.next()){ System.out.print(rs.getInt("管理番号") + ":" + rs.getString("氏名") + rs.getString("電話番号")); System.out.println(rs.getInt("メール") == 1 ? "メールあり" : "メールなし"); } //DB操作? } catch (SQLException e) { System.out.println("表示処理失敗"); e.printStackTrace(); } finally { // Oracle DB 操作終了 olm.closeResouce(); //DB操作? } } // 検索 public void searchData() throws IOException, SQLException { // Oracle DB 操作準備 olm.openResouce(); //DB操作? String name; // 検索する名前 System.out.println("検索する氏名を入力してください"); System.out.print("\n氏名は? --> "); name = br.readLine(); rs = olm.getData("SELECT 管理番号,氏名,電話番号,メール FROM DB1電話番号表 WHERE 氏名 = '" + name + "'"); //DB操作? try { while(rs.next()){ System.out.print(rs.getInt("管理番号") + ":" + rs.getString("氏名") + rs.getString("電話番号")); System.out.println(rs.getInt("メール") == 1 ? "メールあり" : "メールなし"); } //DB操作? } catch (SQLException e) { System.out.println("表示処理失敗"); e.printStackTrace(); } finally { // Oracle DB 操作終了 olm.closeResouce(); //DB操作? } } // 削除 public void deleteData () throws IOException, SQLException { // Oracle DB 操作準備 olm.openResouce(); //DB操作? String name; // 削除する名前 System.out.println("削除する氏名を入力してください"); System.out.print("\n氏名は? --> "); name = br.readLine(); while (name.length() != 10) name += " "; olm.updateData("DELETE FROM DB1電話番号表 WHERE 氏名 = '" + name + "'"); // Oracle DB 操作終了 olm.closeResouce(); //DB操作? System.out.println("正常に削除されました。"); } public static void main(String[] args) throws IOException, SQLException { new Member3(); // コンストラクタの呼び出し } }
Main.java:8: error: class Member3 is public, should be declared in a file named Member3.java public class Member3 { ^ Main.java:11: error: cannot find symbol OracleManager olm; ^ symbol: class OracleManager location: class Member3 Main.java:16: error: cannot find symbol olm = new OracleManager(); //DB??? ^ symbol: class OracleManager location: class Member3 3 errors
s094833993
p00093
Java
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = null; String buf; try{ br = new BufferedReader(new InputStreamReader(System.in)); while((buf = br.readLine()) !=null){ int[] year = new int[2]; for(int i=0;year.length;i++){ year[i]= Integer.parseInt(buf.split(" ")); } boolean check = false; for(int i = year[0];i<year[1];i++){ if(i%4==0 && (i%100 !=0 || i%400 ==0)){ check = true; System.out.printf("%d\n",year); } } System.out.println(); } }finally{ if(br !=null){ br.close(); } } } }
Main.java:11: error: incompatible types: int cannot be converted to boolean for(int i=0;year.length;i++){ ^ Main.java:12: error: incompatible types: String[] cannot be converted to String year[i]= Integer.parseInt(buf.split(" ")); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 2 errors
s613180368
p00093
Java
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = null; String buf; try{ br = new BufferedReader(new InputStreamReader(System.in)); while((buf = br.readLine()) !=null){ int[] year = new int[2]; for(int i=0;i<year.length;i++){ year[i]= Integer.parseInt(buf.split(" ")[i]); } boolean check = false; for(int i = year[0];i<year[1];i++){ if(i%4==0 && (i%100 != 0 || i%400 == 0)){ check = true; System.out.printf("%d\n",i); } } if(!check){ System.out.println("NA"); System.out.println(); } }finally{ if(br !=null){ br.close(); } } } }
Main.java:25: error: 'finally' without 'try' }finally{ ^ Main.java:7: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:31: error: reached end of file while parsing } ^ 3 errors
s419185249
p00093
Java
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = null; String buf; int line = true; try{ br = new BufferedReader(new InputStreamReader(System.in)); while((buf = br.readLine()) !=null){ int[] year = new int[2]; for(int i=0;i<year.length;i++){ year[i]= Integer.parseInt(buf.split(" ")[i]); } if(year[0] == year[1] && year[0] ==0)break; if(line){ line = false; }else{ System.out.println(); boolean check = false; for(int i = year[0];i<=year[1];i++){ if(i%4==0 && (i%100 != 0 || i%400 == 0)){ check = true; System.out.printf("%d\n",i); } } if(!check){ System.out.println("NA"); } } }finally{ if(br !=null){ br.close(); } } } }
Main.java:31: error: 'finally' without 'try' }finally{ ^ Main.java:8: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:37: error: reached end of file while parsing } ^ 3 errors
s365111918
p00093
Java
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ BufferedReader br = null; String buf; int line = true; try{ br = new BufferedReader(new InputStreamReader(System.in)); while((buf = br.readLine()) !=null){ int[] year = new int[2]; for(int i=0;i<year.length;i++){ year[i]= Integer.parseInt(buf.split(" ")[i]); } if(year[0] == year[1] && year[0] ==0)break; if(line){ line = false; }else{ System.out.println();} boolean check = false; for(int i = year[0];i<=year[1];i++){ if(i%4==0 && (i%100 != 0 || i%400 == 0)){ check = true; System.out.printf("%d\n",i); } } if(!check){ System.out.println("NA"); } } }finally{ if(br !=null){ br.close(); } } } }
Main.java:7: error: incompatible types: boolean cannot be converted to int int line = true; ^ Main.java:16: error: incompatible types: int cannot be converted to boolean if(line){ ^ Main.java:17: error: incompatible types: boolean cannot be converted to int line = false; ^ 3 errors
s333488191
p00093
C
#include<stdio.h> /*与えられた期間の間のうるう年をすべて出力*/ void leap_year(int year1, int year2); int main(void) { while(1){ int a, b; /*a は year1 , b は year2*/ scanf("%d %d", &a, &b); if (a == 0 && b == 0){ break; }else if (a == b){ printf("NA\n"); printf("\n"); }else { leap_year(a, b); } } return 0; } void leap_year(int year1, int year2) { int limit; /もしも、うるう年がなかった時に使う/ for(int i = year1; i <= year2; ++i){ if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0){ printf("%d\n", i); }else{ ++limit; } } if (limit = (year2 - year1){ /*うるう年がない場合*/ printf("NA\n"); printf("\n"); }else{ /*うるう年がある場合*/ printf("\n"); } }
main.c: In function 'leap_year': main.c:24:16: error: expected expression before '/' token 24 | int limit; /もしも、うるう年がなかった時に使う/ | ^ main.c:24:23: error: stray '\343' in program 24 | int limit; /<U+3082><U+3057><U+3082><U+3001><U+3046><U+308B><U+3046><U+5E74><U+304C><U+306A><U+304B><U+3063><U+305F><U+6642><U+306B><U+4F7F><U+3046>/ | ^~~~~~~~ main.c:32:33: error: stray '\343' in program 32 | if (limit = (year2 - year1){<U+3000>/*<U+3046><U+308B><U+3046><U+5E74><U+304C><U+306A><U+3044><U+5834><U+5408>*/ | ^~~~~~~~ main.c:38:1: error: expected declaration or statement at end of input 38 | } | ^
s095998740
p00093
C
#include <stdio.h> int main(void){ int a, b; int i, c; while(scanf("%d %d", &a, &b) != EOF){ if(a == 0 && b == 0) break; c = 0;          putchar('\n'); for(i = a; i <= b; i++){ if(i % 4 == 0 && i %100 != 0){ printf("%d\n", i); c++; }else if(i % 400 == 0){ printf("%d\n", i); c++; } } if(c == 0) printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:10:1: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:3: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:5: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:7: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:9: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:11: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:13: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:15: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~ main.c:10:17: error: stray '\343' in program 10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>putchar('\n'); | ^~~~~~~~
s799235120
p00093
C
#include<stdio.h> int main(){ int a,b,i,temp,judge=0; while(1){ ??????temp=0; scanf("%d %d", &a, &b); if((a==0)&&(b==0))break; if(judge!=0) printf("\n"); judge++; for(i=a;i<=b;i++){ if(i%400==0){ printf("%d\n",i); temp=1; } else if((i%4==0)&&(i%100!=0)){ printf("%d\n",i); temp=1; } } if(temp==0)printf("NA\n"); } return 0; }
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ??????temp=0; | ^
s240130527
p00093
C
#include<stdio.h> int main(){ int a,b,i,temp,judge=0; while(1){ ??????temp=0; scanf("%d %d", &a, &b); if((a==0)&&(b==0))break; if(judge!=0) printf("\n"); judge++; for(i=a;i<=b;i++){ if(i%400==0){ printf("%d\n",i); temp=1; } else if((i%4==0)&&(i%100!=0)){ printf("%d\n",i); temp=1; } } if(temp==0)printf("NA\n"); } return (0); }
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ??????temp=0; | ^
s186724017
p00093
C
#include<stdio.h> int main(){ int a,b,i,temp,judge=0; while(1){ ??????temp=0; scanf("%d %d", &a, &b); if((a==0)&&(b==0))break; if(judge!=0) {printf("\n");} judge++; for(i=a;i<=b;i++){ if(i%400==0){ printf("%d\n",i); temp=1; } else if((i%4==0)&&(i%100!=0)){ printf("%d\n",i); temp=1; } } if(temp==0){printf("NA\n");} } return (0); }
main.c: In function 'main': main.c:5:1: error: expected expression before '?' token 5 | ??????temp=0; | ^
s522895160
p00093
C
#include<stdio.h> int main(void){ int before,after; int i; int flag = 0; scanf("%d %d",&before,&after); if(before == 0 && after == 0){ break; } for(i = before;i <= after;i++){ if(i % 4 == 0){ if(i % 100 != 0){ flag = 1; printf("%d",i); } } if(i % 4 == 0){ if(i % 400 == 0){ flag = 1; printf("%d",i); } } } if(flag == 0){ printf("NA"); } flag = 0; while(scanf("%d %d",&before,&after)){ puts(""); if(before == 0 && after == 0){ break; } for(i = before;i <= after;i++){ if(i % 4 == 0){ if(i % 100 != 0){ flag = 1; printf("%d",i); } } if(i % 4 == 0){ if(i % 400 == 0){ flag = 1; printf("%d",i); } } } if(flag == 0){ printf("NA"); } flag = 0; } return 0; }
main.c: In function 'main': main.c:8:13: error: break statement not within loop or switch 8 | break; | ^~~~~
s617561092
p00093
C
#include<stdio.h> int main(void){ int before,after; int i; int flag = 0; scanf("%d %d",&before,&after); for(i = before;i <= after;i++){ if(i % 4 == 0){ if(i % 100 != 0){ flag = 1; printf("%d\n",i); } } if(i % 4 == 0){ if(i % 400 == 0){ flag = 1; printf("%d\n",i); } } } if(flag == 0){ printf("NA\n"); } flag = 0; while(1){ scanf("%d %d",&before,&after) puts(""); if(before == 0 && after == 0){ break; } for(i = before;i <= after;i++){ if(i % 4 == 0){ if(i % 100 != 0){ flag = 1; printf("%d\n",i); } } if(i % 4 == 0){ if(i % 400 == 0){ flag = 1; printf("%d\n",i); } } } if(flag == 0){ printf("NA\n"); } flag = 0; } return 0; }
main.c: In function 'main': main.c:29:30: error: expected ';' before 'puts' 29 | scanf("%d %d",&before,&after) | ^ | ; 30 | puts(""); | ~~~~
s912902239
p00093
C
#include<stdio.h> int main(void){ int before,after; int i; int flag = 0; scanf("%d %d",&before,&after); for(i = before;i <= after;i++){ if(i % 4 == 0&&i % 100 != 0||i%400==0){ flag = 1; printf("%d\n",i); } } } if(flag == 0){ printf("NA\n"); } flag = 0; while(1){ scanf("%d %d",&before,&after); puts(""); if(before == 0 && after == 0){ break; } for(i = before;i <= after;i++){ if(i % 4 == 0&&i % 100 != 0||i%400==0){ flag = 1; printf("%d\n",i); } } } if(flag == 0){ printf("NA\n"); } flag = 0; } return 0; }
main.c:15:9: error: expected identifier or '(' before 'if' 15 | if(flag == 0){ | ^~ main.c:18:9: warning: data definition has no type or storage class 18 | flag = 0; | ^~~~ main.c:18:9: error: type defaults to 'int' in declaration of 'flag' [-Wimplicit-int] main.c:21:5: error: expected identifier or '(' before 'while' 21 | while(1){ | ^~~~~ main.c:34:9: error: expected identifier or '(' before 'if' 34 | if(flag == 0){ | ^~ main.c:37:9: warning: data definition has no type or storage class 37 | flag = 0; | ^~~~ main.c:37:9: error: type defaults to 'int' in declaration of 'flag' [-Wimplicit-int] main.c:37:9: error: redefinition of 'flag' main.c:18:9: note: previous definition of 'flag' with type 'int' 18 | flag = 0; | ^~~~ main.c:39:5: error: expected identifier or '(' before '}' token 39 | } | ^ main.c:40:5: error: expected identifier or '(' before 'return' 40 | return 0; | ^~~~~~ main.c:41:1: error: expected identifier or '(' before '}' token 41 | } | ^
s222982612
p00093
C
include <stdio.h> int main(void){ int a,b,c; c=0; scanf("%d%d",&a,&b); while(1){ scanf("%d%d",&a,&b); if(a==0&&b==0){break;} if(a%4==0){ if(a%400==0&&a%100==0){ printf("%d\n",a); c=c++;} else if(a%100!=0){ printf("%d\n",a); c=c++; } if(a==b){break;} a=a+1;} } if(c==0){printf("NA\n");} return 0; }
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s301255383
p00093
C
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <string> #include <set> #include <map> #include <queue> #include <stack> #include <cmath> #include <functional> #include <numeric> #include <iomanip> #define fi first #define se second #define fcout(n) cout<<fixed<<setprecision((n)) #define cinl(str) getline(cin,(str)) using namespace std; bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;} typedef pair<int,int> pii; typedef long long ll; typedef vector<int> vi; typedef vector<long long > vll; typedef vector< vi > vvi; double pie=acos(-1); int INF=10000009; int dx[4] = { 0,-1,0,1 }; int dy[4] = { -1,0,1,0 }; int main() { int a,b; int y=0; int x=0; int i; while(true){ scanf("%d %d",&a,&b); if(a+b==0) break; if(y!=0) printf("\n"); for(int i=a;i<=b;i++){ if((i%4==0&&i%100!=0)||i%400==0){ printf("%d\n",i); x++; } if(i==b&&x==0){ printf("%s\n","NA"); } } x=0; y++; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s795008158
p00093
C
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <string> #include <set> #include <map> #include <queue> #include <stack> #include <cmath> #include <functional> #include <numeric> #include <iomanip> #define fi first #define se second #define fcout(n) cout<<fixed<<setprecision((n)) #define cinl(str) getline(cin,(str)) using namespace std; bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;} typedef pair<int,int> pii; typedef long long ll; typedef vector<int> vi; typedef vector<long long > vll; typedef vector< vi > vvi; double pie=acos(-1); int INF=10000009; int dx[4] = { 0,-1,0,1 }; int dy[4] = { -1,0,1,0 }; int main() { int a,b; int y=0; int x=0; int i; while(1){ scanf("%d %d",&a,&b); if(a+b==0) break; if(y!=0) printf("\n"); for(i=a;i<=b;i++){ if((i%4==0&&i%100!=0)||i%400==0){ printf("%d\n",i); x++; } if(i==b&&x==0){ printf("%s\n","NA"); } } x=0; y++; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s196094567
p00093
C
#include <stdio.h> int main(void) { int start, end; int year; int flg_null; int flg_dsp; flg_null = 0; while (1){ scanf("%d%d", &start, &end); if (start == 0 && end == 0){ break; } if (flg_null == 1){ printf("\n"); flg_null = 1; } flg_dsp = 0; for (year = start; year <= end; year++){ if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)){ printf("%d\n", year); flg_dsp = 1; } } if (flg_dsp == 0){ printf("NA\n"); } } return (0); } #include <stdio.h> int main(void) { int start, end; int year; int flg_null; int flg_dsp; flg_null = 0; while (1){ scanf("%d%d", &start, &end); if (start == 0 && end == 0){ break; } if (flg_null == 0){ printf("\n"); flg_null = 1; } flg_dsp = 0; for (year = start; year <= end; year++){ if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)){ printf("%d\n", year); flg_dsp = 1; } } if (flg_dsp == 0){ printf("NA\n"); } } return (0); }
main.c:36:5: error: redefinition of 'main' 36 | int main(void) | ^~~~ main.c:3:5: note: previous definition of 'main' with type 'int(void)' 3 | int main(void) | ^~~~
s618782133
p00093
C
#include <stdio.h> int main(void) { int a; int b; int i; int leap; scanf("%d%d", &a, &b); while(a != 0 && b != 0){ leap = 1; for (i = a; i <= b; i++){ if (i % 400 == 0){ printf("%d\n", i); leap = 0; } else if((i % 4 == 0) && (i % 100 != 0)){ printf("%d\n", i); leap = 0; } } if(leap != 0){ printf("NA\n"); ツ ツ ツ ツ ツ ツ ツ ツ ツ } scanf("%d%d", &a, &b); } return (0); }
main.c: In function 'main': main.c:24:3: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:1: error: unknown type name '\U000030c4' 24 | ツ ツ ツ ツ ツ ツ ツ ツ ツ } | ^~ main.c:24:7: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U000030c4' 24 | ツ ツ ツ ツ ツ ツ ツ ツ ツ } | ^~ main.c:24:11: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:15: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:19: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:23: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:27: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:31: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:24:35: error: stray '\343' in program 24 | <U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000><U+30C4><U+3000>} | ^~~~~~~~ main.c:28:1: error: expected declaration or statement at end of input 28 | } | ^
s392837807
p00093
C
#include<stdio.h> int main(){ int a,i,b,count=0; while(1) { count=0; scanf("%d%d",&a,&b); printf("\n"); if(a==0 && b==0){ break; } for(i=a;i<=b;i++) { if(i%4==0 && i%100!=0) { printf("%d\n",i); count++; } else if(i%400==0) { printf("%d\n",i); count++; } } if(count==0) { printf("NA\n"); } printf("\n"); } return 0;
main.c: In function 'main': main.c:38:3: error: expected declaration or statement at end of input 38 | return 0; | ^~~~~~
s886760766
p00093
C
a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:9: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c: In function 'main': main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~ main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:50: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:139: error: implicit declaration of function 'elsefor' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~~~ main.c:1:150: error: expected ')' before ';' token 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ~ ^ | ) main.c:1:156: error: expected ';' before 'printf' 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~~ | ; main.c:1:199: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} main.c:1:199: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:199: note: include '<stdlib.h>' or provide a declaration of 'exit'
s597168697
p00093
C
a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:9: error: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^ main.c:1:17: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c: In function 'main': main.c:1:28: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} main.c:1:28: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~ main.c:1:28: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:50: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:139: error: implicit declaration of function 'elsefor' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~~~ main.c:1:150: error: expected ')' before ';' token 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ~ ^ | ) main.c:1:156: error: expected ';' before 'printf' 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~~~ | ; main.c:1:199: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} main.c:1:199: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | a,b,i,c,k[3100];main(){for(scanf("%d%d",&a,&b);a;puts("")){c=0;for(i=a;i<=b;i++)if(i%400==0||(i%100!=0&&i%4==0))k[c++]=i;if(!c)puts("NA");elsefor(i=0;i<c;)printf("%d\n",k[i++]);scanf("%d%d",&a,&b);}exit(0);} | ^~~~ main.c:1:199: note: include '<stdlib.h>' or provide a declaration of 'exit'
s225724877
p00093
C
#include <stdio.h> int main(int argc, const char * argv[]) { int a, b, y; while(1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) { break; } else { int cnt = 0; if (cnt != 0) { printf("\n"); } for (y = a; y <= b; y++) { if ((y % 400 == 0) || (y % 4 == 0 && y % 100 != 0)) { printf("%d\n", y); cnt++; } } if (cnt == 0) { printf("NA\n"); cnt++; } } } return 0;
main.c: In function 'main': main.c:30:5: error: expected declaration or statement at end of input 30 | return 0; | ^~~~~~
s838465669
p00093
C
#include <stdio.h> struct year { int start; int end; }; void outputLeapyear(int, int); int main(void) { int isInit = 0; struct year year; while (scanf("%d %d", &year.start, &year.end), !(year.start == 0 && year.end == 0)) { if (isInit == 0) { isInit++; } else { printf("\n"); outputLeapyear(year.start, year.end); } return 0; } void outputLeapyear(int start, int end) { int i; int count = 0; for (i = start; i <= end; i++) { if (i % 400 == 0) { printf("%d\n", i); count++; } else if (i % 100 == 0) continue; else if (i % 4 == 0) { printf("%d\n", i); count++; } } if (!count) printf("NA\n"); }
main.c: In function 'main': main.c:45:1: error: expected declaration or statement at end of input 45 | } | ^
s351151223
p00093
C
include<stdio.h> main(){ int a,b,i,x,y=0; while(1){ /* 無限ループ */ x=0; y++; scanf("%d %d",&a,&b); if(a==0 && b==0){ break; //ループを抜ける } if(y!=1){ printf("\n"); } for(i=a;i<=b;i++){ if(i%400==0){ printf("%d\n",i); x=1; } else if(i%4==0 && i%100!=0){ printf("%d\n",i); x=1; } } if(x==0){ printf("NA\n"); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s200686707
p00093
C
#include <stdio.h> int main(void) { int a,b; int i; int uru; while(1){ scanf("%d",&a); scanf("%d",&b); uru=0; if(a==0 && b==0) break; for(i=a;i<=b;i++){ if(i%4==0 && i%100!=0){ printf("%d\n",i); uru++; }else if(i%100==0 && i%400!=0) printf(""); else if(i%400==0){00 printf("%d\n",i); uru++; } } if(uru==0){ printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:23:45: error: expected ';' before 'printf' 23 | else if(i%400==0){00 | ^ | ; 24 | printf("%d\n",i); | ~~~~~~
s878791017
p00093
C
#include<stdio.h> int main(){ int a, b, i, c = true; while(scanf("%d%d", &a, &b)){ if(a == 0 && b == 0) break; for(i = a; i <= b; i++){ if(i % 4 == 0){ if(i % 100 == 0){ if(i % 400 == 0){ printf("%d\n", i); c = false; } }else{ printf("%d\n", i); c = false; } } } if(c) printf("NA\n"); c = true; } return 0; }
main.c: In function 'main': main.c:4:26: error: 'true' undeclared (first use in this function) 4 | int a, b, i, c = true; | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in 4 | int a, b, i, c = true; | ^~~~ main.c:12:53: error: 'false' undeclared (first use in this function) 12 | c = false; | ^~~~~ main.c:12:53: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s766775575
p00093
C
#include<stdio.h> int main(){ int a, b, i, c = true; while(scanf("%d%d", &a, &b)){ if(a == 0 && b == 0) break; for(i = a; i <= b; i++){ if(i % 4 == 0){ if(i % 100 == 0){ if(i % 400 == 0){ printf("%d\n", i); c = false; } }else{ printf("%d\n", i); c = false; } } } if(c) printf("NA\n"); c = true; } return 0; }
main.c: In function 'main': main.c:4:26: error: 'true' undeclared (first use in this function) 4 | int a, b, i, c = true; | ^~~~ main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include<stdio.h> +++ |+#include <stdbool.h> 2 | main.c:4:26: note: each undeclared identifier is reported only once for each function it appears in 4 | int a, b, i, c = true; | ^~~~ main.c:12:53: error: 'false' undeclared (first use in this function) 12 | c = false; | ^~~~~ main.c:12:53: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s505751495
p00093
C
#include <stdio.h> int main( void ) { int i, a, b, first = 1, exist; while ( scanf( "%d %d", &a, &b ), a ) { if ( !first ) putchar( '\n' ); exist = 0; for ( i = ( ( a - 1 ) / 4 * 4 + 4; i <= b; i += 4 ) if ( !( i % 4 ) && i % 25 || !( i % 400 ) ) { printf( "%d\n", i ); exist = 1; } if ( !exist ) puts( "NA" ); first = 0; } return 0; }
main.c: In function 'main': main.c:11:50: error: expected ')' before ';' token 11 | for ( i = ( ( a - 1 ) / 4 * 4 + 4; i <= b; i += 4 ) | ~ ^ | ) main.c:11:68: error: expected ';' before 'if' 11 | for ( i = ( ( a - 1 ) / 4 * 4 + 4; i <= b; i += 4 ) | ^ | ; 12 | if ( !( i % 4 ) && i % 25 || !( i % 400 ) ) { | ~~ main.c:21:9: error: expected expression before '}' token 21 | } | ^ main.c:21:9: error: expected expression before '}' token
s907240760
p00093
C++
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s470133903
p00093
C++
#include <stdio.h> int count_number(void); int main(void) {  int a; int b; while (1) { scanf("%d %d", &a, &b); if (a == 0 && b == 0) { break; } else { int count = 0; for (int i=a; i++; i<=b) { if (((i % 4) == 0) && ((i % 100) != 0) && ((i % 400) == 0)) { printf("%d\n", i); count++; } } if (count == 0){ printf("NA\n\n"); } else { printf("\n"); } } } }
a.cc:7:1: error: extended character   is not valid in an identifier 7 |  int a; | ^ a.cc: In function 'int main()': a.cc:7:1: error: '\U00003000int' was not declared in this scope 7 |  int a; | ^~~~~ a.cc:10:25: error: 'a' was not declared in this scope 10 | scanf("%d %d", &a, &b); | ^
s613940941
p00093
C++
#include<stdio.h> /*与えられた期間の間のうるう年をすべて出力*/ void leap_year(int year1, int year2); int main(void) { while (1){ int a, b; /*a は year1 , b は year2*/ scanf("%d %d", &a, &b); if (a == 0 && b == 0){ break; }else if (a == b){ printf("\n"); printf("NA\n"); printf("\n"); }else { leap_year(a, b); c } } return 0; } void leap_year(int year1, int year2) { int limit = 0; /*もしも、うるう年がなかった時に使う*/ printf("\n"); for (int i = year1; i <= year2; ++i){ /*i は年を表す*/ if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0){ printf("%d\n", i); }else{ ++limit; } } if (limit == (year2 - year1 + 1)){/*うるう年がない場合*/ printf("NA\n"); printf("\n"); }else{ /*うるう年がある場合*/ printf("\n"); } }
a.cc: In function 'int main()': a.cc:18:6: error: 'c' was not declared in this scope 18 | c } | ^
s226001296
p00093
C++
/* 2014.07.04 1230~1237 C language Lecture week ∞ */ #include <stdio.h> int leap_chk ( int year ); int main (void) { int init; int last; int count = 0; scanf ( "%d", &init ); scanf ( "%d", &last ); for ( int ly = init; ly <= last; ly ++ ) { if ( leap_chk ( ly ) ) { printf ( "%d\n", ly ); count ++; } } if ( count == 0 ) { printf ( "NA\n" ); } printf ( "\n" ); return 0; } int leap_chk ( int year ) { if ( year % 4 == 0 ) { if ( year % 100 == 0 ) { if ( year % 400 == 0 ) { return 1; } else { return 0; } } else { return 1; } else { return 0; } }
a.cc: In function 'int leap_chk(int)': a.cc:48:5: error: expected '}' before 'else' 48 | else { | ^~~~ a.cc:38:26: note: to match this '{' 38 | if ( year % 4 == 0 ) { | ^
s328034899
p00093
C++
#include <stdio.h> void Leap_Year(int start_year, int end_year) { if((start_year != 0) || (end_year != 0)) { for(int i = start_year; i <= end_year; ++i) { if(i % 400 != 0) { if((i % 100 != 0) && (i % 4 == 0)) { printf("%d\n", i); } else { printf("NA"); } else { printf("%d\n", i); } } } } int main(void) { int start_year, end_year; scanf("%d %d", &start_year, &end_year); Leap_Year(start_year, end_year); return 0; }
a.cc: In function 'void Leap_Year(int, int)': a.cc:12:15: error: expected '}' before 'else' 12 | } else { | ^~~~ a.cc:7:30: note: to match this '{' 7 | if(i % 400 != 0) { | ^