submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s093605979
p03937
C++
#include<bits/stdc++.h> using namespace std; int a[10][10],m,n,flag; char kk[10]; void act(int x,int y){ if(x==m-1&&y==n-1){ for(int i=0;i<m;++i)for(int j=0;j<n;++j){ if(a[i][j])return; } flag=1; return; } if(flag==1)return; if(a[x+1][y]){ a[x+1][y]=0; dfs(x+1,y); a[x+1][y]=1; } if(a[x][y+1]){ a[x][y+1]=0; dfs(x,y+1); a[x][y+1]=1; } if(!a[x][y+1]&&!a[x+1][y])return; } int main(){ scanf("%d%d",&m,&n); for(int i=0;i<=m;++i){ gets(kk); for(int j=0;j<n;++j) if(kk[j]=='#')a[i-1][j]=1; } if(a[0][0]){ a[0][0]=0; act(0,0); } if(flag)cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'void act(int, int)': a.cc:16:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'? 16 | dfs(x+1,y); | ^~~ | ffs a.cc:21:9: error: 'dfs' was not declared in this scope; did you mean 'ffs'? 21 | dfs(x,y+1); | ^~~ | ffs a.cc: In function 'int main()': a.cc:29:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 29 | gets(kk); | ^~~~ | getw
s539719524
p03937
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) #define rev(a) reverse(a.begin(),a.end()) #define fi first #define se second #define co(a) cout<<a<<endl #define sz size() #define bgn begin() #define en end() #define pb(a) push_back(a) #define pp() pop_back() #define V vector #define P pair #define V2(a,b,c) V<V<int>> a(b,V<int>(c)) #define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d)) #define incin(a) int a; cin>>a #define yuko(a) setprecision(a) #define uni(a) a.erase(unique(a.begin(),a.end()),a.end()) //#define min min<int> //#define max max<int> template<class T> void cou(vector<vector<T>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } } /*template<> void cou(vector<vector<char>> a){ int b=a.size(); int c=a[0].size(); fo(i,b){ fo(j,c){ cout<<a[i][j]; if(j==c-1) cout<<endl; else cout<<' '; } } }*/ int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int a){ return a*(a+1)/2; } /*int lcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return d*e/f; } */ int gcm(int a,int b){ int d=a,e=b,f; if(a<b) swap(a,b); int c,m=1; while(m){ c=a%b; if(c==0){ f=b; m--; } else{ a=b; b=c; } } return f; }/* /*bool prime(int a){ if(a<2) return false; else if(a==2) return true; else if(a%2==0) return false; double b=sqrt(a); for(int i=3;i<=b;i+=2){ if(a%i==0){ return false; } } return true; }*/ bool prime(const unsigned long long n){ switch(n){ case 0: // fall-through case 1: return false; case 2: // fall-through case 3: return true; } // n > 3 が保証された if(n%2 == 0) return false; if(n%3 == 0) return false; // 2と3の倍数でないので6の倍数ではないことが保証された if(n%6 != 1 && n%6 != 5) return false; // 6の倍数前後の数(素数かもしれない数)であることが保証された // 6の倍数前後の数を使って試し割りをする for(unsigned long long i=5;i*i<=n;i+=6){ if(n%i == 0) return false; // 6n-1 if(n%(i+2) == 0) return false; // 6n+1 } return true; } struct Union{ vector<int> par; Union(int a){ par= vector<int>(a,-1); } int find(int a){ if(par[a]<0) return a; else return par[a]=find(par[a]); } bool same(int a,int b){ return find(a)==find(b); } int Size(int a){ return -par[find(a)]; } void unite(int a,int b){ a=find(a); b=find(b); if(a==b) return; if(Size(b)>Size(a)) swap<int>(a,b); par[a]+=par[b]; par[b]=a; } }; int ketas(int a){ string b=to_string(a); int c=0; fo(i,keta(a)){ c+=b[i]-'0'; } return c; } /*int gcm(int a,int b){ if(b==0) return a; return gcm(b,a%b); }*/ int lcm(int a,int b){ return a/gcm(a,b)*b; } /*struct aa{ vector<int> gt; aa(int n){ gt= vector<int>(n, 1); } void c(V<int> d,int b){ if(d[b]==0){ gt[d[b]-1]++; gt[gt.sz-1]++; } else{ gt[d[b]-1]++; c(d,d[d[b]]-1); } } void cok(int a){ cout<<gt[a-1]<<endl; fo(i,a-1) cout<<gt[i]<<endl; } }; */ /*struct dfs(){ }*/ bool fe(int a,int b){ a%=10; b%=10; if(a==0) a=10; if(b==0) b=10; if(a>b) return true; else return false; } signed main(){ int a,b; cin>>a>>b; int c=a+b-1,d=0; V<string> d(a); fo(i,a) cin>>d[i]; fo(i,a){ fo(j,b){ if(d[i][j]=='#') d++; } } if(d==c) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:226:13: error: conflicting declaration 'std::vector<std::__cxx11::basic_string<char> > d' 226 | V<string> d(a); | ^ a.cc:225:15: note: previous declaration as 'long long int d' 225 | int c=a+b-1,d=0; | ^ a.cc:228:9: error: invalid types 'long long int[long long int]' for array subscript 228 | cin>>d[i]; | ^ a.cc:231:11: error: invalid types 'long long int[long long int]' for array subscript 231 | if(d[i][j]=='#') | ^
s643980640
p03937
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<map> #include<set> #include<cstdio> #include<cmath> #include<numeric> #include<queue> #include<stack> #include<cstring> #include<limits> #include<functional> #include<unordered_set> #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define pb push_back #define eb emplace_back using ll=long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 50; template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; void solve(){ int h,w; cin>>h>>w; rep(i,h)rep(j,w){ char c; cin>>c; if(c=='#')++cnt; } if(cnt==h*w-1)cout<<"Possible\n";//最短経路分のマスしか存在しない else cout<<"Impossible\n"; } signed main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); solve(); return 0; }
a.cc: In function 'void solve()': a.cc:48:21: error: 'cnt' was not declared in this scope; did you mean 'int'? 48 | if(c=='#')++cnt; | ^~~ | int a.cc:50:8: error: 'cnt' was not declared in this scope; did you mean 'int'? 50 | if(cnt==h*w-1)cout<<"Possible\n";//最短経路分のマスしか存在しない | ^~~ | int
s585986327
p03937
C++
#include <iostream> #include <cstring> #include <algorithm> #include <vector> #include <string> #include <math.h> #include <stdio.h> #include <iomanip> #include <limits> #include <list> #include <queue> #include <tuple> #include <map> #include <set> #include <sstream> using namespace std; #define MOD (long long int)(1e9+7) #define ll long long int #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=1; i<=(int)(n); i++) #define REP(i,n) for(int i=n-1; i>=0; i--) #define REPS(i,n) for(int i=n; i>0; i--) #define FOR(i,a,b) for(int i=a; i<(int)(b); i++) #define ALL(x) (x).begin(),(x).end() #define RALL(a) (a).rbegin(), (a).rend() #define SORT(c) sort(ALL(x)) #define CLR(a) memset((a), 0 ,sizeof(a)) #define PB push_back #define MP make_pair #define SP << " " << const int INF = 1001001001; const ll LINF = 100100100100100100; const double EPS = 1e-10; const double PI = acos(-1.0); typedef pair<int,int> PII; typedef vector<int> VI; typedef vector<VI> VVI; template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } __attribute__((constructor)) void initial(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } signed main(){ int h,w; cin>>h>>w; bool visited[h][w]; vector<string> a(h); rep(i,h) cin>>a[i], rep(j,w) visited[i][j]=false; queue<PII> q; q.push({0,0}); visited[0][0]=true; while(!q.empty()){ PII p = q.front(); q.pop(); bool c1=false, c2=false; visited[p.first][p.second]=true; if(p.first==h-1&&p.second==w-1) return cout<<"Possible"<<endl,0; if(p.first+1<h&&p.second<w){ if(a[p.first+1][p.second]=='#') q.push({p.first+1,p.second}), c1=true; } if(p.first<h&&p.second+1<w){ if(a[p.first][p.second+1]=='#') q.push({p.first,p.second+1}), c2=true; } if(p.first-1>=0){ if(!visited[p.first-1][p.second]&&a[p.first-1][p.second]=='#') break; } if(p.second-1>=0){ if(!visited[p.first][p.second-1]&&a[p.first][p.second-1]=='#') break; } if(c1==c2) break; } cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:19:18: error: expected primary-expression before 'for' 19 | #define rep(i,n) for(int i=0; i<(int)(n); i++) | ^~~ a.cc:54:44: note: in expansion of macro 'rep' 54 | vector<string> a(h); rep(i,h) cin>>a[i], rep(j,w) visited[i][j]=false; | ^~~ a.cc:54:48: error: 'j' was not declared in this scope 54 | vector<string> a(h); rep(i,h) cin>>a[i], rep(j,w) visited[i][j]=false; | ^ a.cc:19:31: note: in definition of macro 'rep' 19 | #define rep(i,n) for(int i=0; i<(int)(n); i++) | ^
s659056428
p03937
C++
#include <iostream> #include <vector> #include <cassert> #include <algorithm> #include <functional> #include <queue> using namespace std; vector<vector<int>> vec; int h,w; int main(){ cin >> h >> w ; vec.resize(h,vector<int>(w)); for(int i=0;i<h;i++){ string s; cin >> s; for(int j=0;j<w;j++){ vec[i][j]=s[j]; } } queue<pair<int,int>> q; vector<vector<int>> reg(h,vector<int>(w)); q.push(pair<int,int>(0,0)); reg[0][0]=0; bool h1=true; while(!q.empty()){ int y=q.front().first; int x=q.front().second; q.pop(); bool h2=false; vec[y][x]='?'; if(y+1<h){ if(vec[y+1][x]=='#'){ q.push(pair<int,int>(y+1,x)); reg[y+1][x]=reg[y][x]+1; h2=true; } } if(x+1<w){ if(vec[y][x+1]=='#'){ q.push(pair<int,int>(y,x+1)); reg[y][x+1]=reg[y][x]+1; if(h2){ h1=false; break; } } } } if(vec[h-1][w-1]=='#'||ref[h-1][w-1]!=h+w-2){ cout<<"Impossible"<<endl; }else{ cout<<"Possible"<<endl; } }
a.cc: In function 'int main()': a.cc:50:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript 50 | if(vec[h-1][w-1]=='#'||ref[h-1][w-1]!=h+w-2){ | ^
s762233768
p03937
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{ public: ll x, y; XY() {x = y = 0;} XY(ll u, ll v) {x = u; y = v;} }; template<typename T1, typename T2> void chmin(T1 &a, T2 b) {if(a > b) a = b;} template<typename T1, typename T2> void chmax(T1 &a, T2 b) {if(a < b) a = b;} template<typename T1, typename T2> ll mypow(T1 a, T2 n){ if(n == 0) return 1; if(n == 1) return a; if(n % 2) return a * mypow(a, n - 1); ll tmp = mypow(a, n / 2); return tmp * tmp; } template<typename T> int BS(vector<T> V, int left, int right, T key){ int mid = (left + right) / 2; if(V[mid] <= key) left = mid; else right = mid; if(right - mid == 1) return left; else return BS(V, left, right, key); } ll comb(ll n, ll r){ ll res = 1; rep(i, 0, r){ res *= n - i; res /= i + 1; } return res; } ///////////////////////////////////////////////////////// int DFS(vector<vector<char>> &A, int h, int w){ if(h == A.size() - 1 && w == A[0].size() - 1) return 1; int res = 0; if(h < A.size() - 1) if(A[h + 1][w] == '#') if(DFS(A, h + 1, w)) res = 1; if(w < A[0].size() - 1) if(A[h][w + 1] == '#') if(DFS(A, h, w + 1)) res = 1; return res; } void Main() { int H, W; cin >> H >> W; vector<vector<char>> A(H, vector<char>(W)); int cnt = 0; rep(i, 0, H) rep(j, 0, W) { cin >> A[i][j]; if(A[i][j] == '#') cnt++; } string res; int cnt = 0; if(cnt == H + W - 1 && DFS(A, 0, 0)) res = "Possible"; else res = "Impossible"; cout << res << endl; } ///////////////////////////////////////////////////////// int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << std::fixed << std::setprecision(15); Main(); }
a.cc: In function 'void Main()': a.cc:71:7: error: redeclaration of 'int cnt' 71 | int cnt = 0; | ^~~ a.cc:65:7: note: 'int cnt' previously declared here 65 | int cnt = 0; | ^~~
s272405279
p03937
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, j, n) for (ll i = j; i < n; i++) #define all(x) (x).begin(),(x).end() #define INF (1000000000) #define MOD (1000000007) #define MAX (100000) #define pii pair<int, int> ///////////////////////////////////////////////////////// class XY{ public: ll x, y; XY() {x = y = 0;} XY(ll u, ll v) {x = u; y = v;} }; template<typename T1, typename T2> void chmin(T1 &a, T2 b) {if(a > b) a = b;} template<typename T1, typename T2> void chmax(T1 &a, T2 b) {if(a < b) a = b;} template<typename T1, typename T2> ll mypow(T1 a, T2 n){ if(n == 0) return 1; if(n == 1) return a; if(n % 2) return a * mypow(a, n - 1); ll tmp = mypow(a, n / 2); return tmp * tmp; } template<typename T> int BS(vector<T> V, int left, int right, T key){ int mid = (left + right) / 2; if(V[mid] <= key) left = mid; else right = mid; if(right - mid == 1) return left; else return BS(V, left, right, key); } ll comb(ll n, ll r){ ll res = 1; rep(i, 0, r){ res *= n - i; res /= i + 1; } return res; } ///////////////////////////////////////////////////////// int DFS(vector<vector<char>> &A, int h, int w){ if(h == A.size() - 1 && w == A[0].size() - 1) return 1; int res = 0; if(h < A.size() - 1) if(A[h + 1][w] == '#') if(DFS(A, h + 1, w)) res = 1; if(w < A[0].size() - 1) if(A[h][w + 1] == '#') if(DFS(A, h, w + 1)) res = 1; return res; } void Main() { int H, W; cin >> H >> W; vector<vector<char>> A(H, vector<char>(W)); int cnt = 0; rep(i, 0, H) rep(j, 0, W) { cin >> A[i][j]; if(A[i][j] == '#' cnt++;) } string res; int cnt = 0; if(cnt == H + W - 1 && DFS(A, 0, 0)) res = "Possible"; else res = "Impossible"; cout << res << endl; } ///////////////////////////////////////////////////////// int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << std::fixed << std::setprecision(15); Main(); }
a.cc: In function 'void Main()': a.cc:68:22: error: expected ';' before 'cnt' 68 | if(A[i][j] == '#' cnt++;) | ^~~~ | ; a.cc:68:29: error: expected primary-expression before ')' token 68 | if(A[i][j] == '#' cnt++;) | ^ a.cc:69:3: error: expected primary-expression before '}' token 69 | } | ^ a.cc:71:7: error: redeclaration of 'int cnt' 71 | int cnt = 0; | ^~~ a.cc:65:7: note: 'int cnt' previously declared here 65 | int cnt = 0; | ^~~
s998844697
p03937
C++
#include <bits/stdc++.h> using namespace std; int main(){ int H,W,sharp=0; cin >> H >> W; vector<string> A(H); for(int i=0;i<H;i++){ cin >> A[i]; } for(int i=0;i<H-1;i++){ for(int j=0;j<W-1;j++){ if(A[i][j]=='#'){ sharp++; } } } } if(sharp == H+W-1){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; } }
a.cc:22:5: error: expected unqualified-id before 'if' 22 | if(sharp == H+W-1){ | ^~ a.cc:24:6: error: expected unqualified-id before 'else' 24 | }else{ | ^~~~ a.cc:27:1: error: expected declaration before '}' token 27 | } | ^
s047251783
p03937
C++
#include <bits/stdc++.h> using namespace std; int main(){ int H,W; bool ok = true; cin >> H >> W; vector<string> A(H); for(int i=0;i<H;i++){ cin >> A[i]; } for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(A[i][j]=='#' && j==w-1){ if((A[i+1][j]=='#')^(A[i][j-1]=='.')!=1){ ok = false; } }else if(A[i][j]=='#'){ if((A[i+1][j]=='#')^(A[i][j+1]=='#')!=1){ ok = false; } } } } if(ok){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; } }
a.cc: In function 'int main()': a.cc:17:35: error: 'w' was not declared in this scope 17 | if(A[i][j]=='#' && j==w-1){ | ^
s017916115
p03937
C++
#include <iostream> #include <string> using namespace std; int main() { int H,W;cin>>H>>W; int ans =0; for(int i=0;i<H;++i){ string S;cin>>S; for (aut c:S)if(c=='#') ++ans; } if (ans==H+W-1)cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:10:10: error: 'aut' was not declared in this scope; did you mean 'auto'? 10 | for (aut c:S)if(c=='#') ++ans; | ^~~ | auto a.cc:11:3: error: expected primary-expression before '}' token 11 | } | ^ a.cc:10:35: error: expected ';' before '}' token 10 | for (aut c:S)if(c=='#') ++ans; | ^ | ; 11 | } | ~ a.cc:11:3: error: expected primary-expression before '}' token 11 | } | ^ a.cc:10:35: error: expected ')' before '}' token 10 | for (aut c:S)if(c=='#') ++ans; | ~ ^ | ) 11 | } | ~ a.cc:11:3: error: expected primary-expression before '}' token 11 | } | ^
s251172376
p03937
C++
#include <bits/stdc++.h> using namespace std; int main(){ int h,w; cin>>h>>w; vector<vector<char>> a(h, vector<char>(w)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>a.at(i).at(j); } } int count=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(a.at(i).at(j)=='#'){ count++ } } } if(count==h+w-1){ cout<<"Possible"; } else{ cout<<"Impossible"; } }
a.cc: In function 'int main()': a.cc:16:16: error: expected ';' before '}' token 16 | count++ | ^ | ; 17 | } | ~
s587976542
p03937
C++
#include <bits/stdc++.h> using namespace std; const int N = 2e4 + 7; int p[N], a[N], b[N]; int n; int main() { cin >> n; for (int i = 1; i <= n; i++){ cin >> p[i]; } for (int i = 1; i <= n; i++) { a[I] } }
a.cc: In function 'int main()': a.cc:14:4: error: 'I' was not declared in this scope 14 | a[I] | ^
s698694973
p03937
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w,n=0;cin>>h>>w; vector<vector<char>>a(h,vector<char>(w)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>a.at(i).at(j); if(a.at(i).at(j)=='#')n++; } } if(n!=h+w-1)cout<<"Impossible"<<endl; else{ vector<pair<int,int>>p(n); int s=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(a.at(i).at(j)=='#'){ p.at(s).first=j; p.at(s).second=i; s++; } if(s==n-1)break; } } int t=0; for(int i=0;i<n-1;i++){ if(p.at(i)>p.at(i+1)){ t++; break; } } if(t>0)coutt<<"Impossible"<<endl; else cout<<"Possible"<<endl; } }
a.cc: In function 'int main()': a.cc:33:12: error: 'coutt' was not declared in this scope 33 | if(t>0)coutt<<"Impossible"<<endl; | ^~~~~
s694911235
p03937
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w,n=0;cin>>h>>w; vector<vector<char>>a(h,vector<char>(w)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>a.at(i).at(j); if(a.at(i).at(j)=='#')n++; } } if(n!=h+w-1)cout<<"Impossible"<<endl; else{ vector<pair<int,int>>p(n); int s=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(a.at(i).at(j)=='#'){ p.at(s)=(j,i); s++; } if(s==n-1)break; } } int t=0; for(int i=0;i<n-1;i++){ if(p.at(i)>p.at(i+1)){ t++; break; } } if(t>0)coutt<<"Impossible"<<endl; else cout<<"Possible"<<endl; } }
a.cc: In function 'int main()': a.cc:19:23: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int') 19 | p.at(s)=(j,i); | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = int; _T2 = int]' 946 | operator=(const pair<_U1, _U2>& __p) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:946:9: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 19 | p.at(s)=(j,i); | ^ /usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = int; _T2 = int]' 957 | operator=(pair<_U1, _U2>&& __p) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:957:9: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 19 | p.at(s)=(j,i); | ^ /usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<int, int>&]' 921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>, | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:923:65: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, const std::pair<int, int>&, const std::__nonesuch&>' {aka 'const std::pair<int, int>&'} 921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 922 | is_copy_assignable<_T2>>::value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 923 | const pair&, const __nonesuch&> __p) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<int, int>&&]' 931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>, | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:933:55: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, std::pair<int, int>&&, std::__nonesuch&&>' {aka 'std::pair<int, int>&&'} 931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 932 | is_move_assignable<_T2>>::value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 933 | pair&&, __nonesuch&&> __p) | ~~~~~~~~~~~~~~~~~~~~~~^~~ a.cc:32:12: error: 'coutt' was not declared in this scope 32 | if(t>0)coutt<<"Impossible"<<endl; | ^~~~~
s754909947
p03937
C++
#include<bits/stdc++.h> using namespace std; int main(){ int h,w,n=0;cin>>h>>w; vectot<vector<char>>a(h,vector<char>(w)); for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>a.at(i).at(j); if(a.at(i).at(j)=='#')n++; } } if(n!=h+w-1)cout<<"Impossible"<<endl; else{ vector<pair<int,int>>p(n); int s=0; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ if(a.at(i).at(j)=='#'){ p.at(s)=(j,i); s++; } if(s==n-1)break; } } int t=0; for(int i=0;i<n-1;i++){ if(p.at(i)>p.at(i+1)){ t++; break; } } if(t>0)coutt<<"Impossible"<<endl; else cout<<"Possible"<<endl; } }
a.cc: In function 'int main()': a.cc:5:3: error: 'vectot' was not declared in this scope 5 | vectot<vector<char>>a(h,vector<char>(w)); | ^~~~~~ a.cc:5:21: error: expected primary-expression before '>' token 5 | vectot<vector<char>>a(h,vector<char>(w)); | ^~ a.cc:5:23: error: 'a' was not declared in this scope 5 | vectot<vector<char>>a(h,vector<char>(w)); | ^ a.cc:19:23: error: no match for 'operator=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'} and 'int') 19 | p.at(s)=(j,i); | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:946:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, const _U1&>, std::is_assignable<_T2&, const _U2&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(const std::pair<_U1, _U2>&) [with _U2 = _U1; _T1 = int; _T2 = int]' 946 | operator=(const pair<_U1, _U2>& __p) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:946:9: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'const std::pair<_T1, _T2>' and 'int' 19 | p.at(s)=(j,i); | ^ /usr/include/c++/14/bits/stl_pair.h:957:9: note: candidate: 'template<class _U1, class _U2> typename std::enable_if<std::__and_<std::is_assignable<_T1&, _U1&&>, std::is_assignable<_T2&, _U2&&> >::value, std::pair<_T1, _T2>&>::type std::pair<_T1, _T2>::operator=(std::pair<_U1, _U2>&&) [with _U2 = _U1; _T1 = int; _T2 = int]' 957 | operator=(pair<_U1, _U2>&& __p) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:957:9: note: template argument deduction/substitution failed: a.cc:19:23: note: mismatched types 'std::pair<_T1, _T2>' and 'int' 19 | p.at(s)=(j,i); | ^ /usr/include/c++/14/bits/stl_pair.h:921:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_copy_assignable<_T1>, std::is_copy_assignable<_T2> >::value), const std::pair<_T1, _T2>&, const std::__nonesuch&> = const std::pair<int, int>&]' 921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>, | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:923:65: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, const std::pair<int, int>&, const std::__nonesuch&>' {aka 'const std::pair<int, int>&'} 921 | operator=(__conditional_t<__and_<is_copy_assignable<_T1>, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 922 | is_copy_assignable<_T2>>::value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 923 | const pair&, const __nonesuch&> __p) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_pair.h:931:7: note: candidate: 'std::pair<_T1, _T2>& std::pair<_T1, _T2>::operator=(std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&>) [with _T1 = int; _T2 = int; std::__conditional_t<((bool)std::__and_<std::is_move_assignable<_Tp>, std::is_move_assignable<_T2> >::value), std::pair<_T1, _T2>&&, std::__nonesuch&&> = std::pair<int, int>&&]' 931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>, | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:933:55: note: no known conversion for argument 1 from 'int' to 'std::__conditional_t<true, std::pair<int, int>&&, std::__nonesuch&&>' {aka 'std::pair<int, int>&&'} 931 | operator=(__conditional_t<__and_<is_move_assignable<_T1>, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 932 | is_move_assignable<_T2>>::value, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 933 | pair&&, __nonesuch&&> __p) | ~~~~~~~~~~~~~~~~~~~~~~^~~ a.cc:32:12: error: 'coutt' was not declared in this scope 32 | if(t>0)coutt<<"Impossible"<<endl; | ^~~~~
s738774228
p03937
C++
#ifndef _GLIBCXX_NO_ASSERT #include <cassert> #endif #include <cctype> #include <cerrno> #include <cfloat> #include <ciso646> #include <climits> #include <clocale> #include <cmath> #include <csetjmp> #include <csignal> #include <cstdarg> #include <cstddef> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #if __cplusplus >= 201103L #include <ccomplex> #include <cfenv> #include <cinttypes> #include <cstdbool> #include <cstdint> #include <ctgmath> #include <cwchar> #include <cwctype> #endif // C++ #include <algorithm> #include <bitset> #include <complex> #include <deque> #include <exception> #include <fstream> #include <functional> #include <iomanip> #include <ios> #include <iosfwd> #include <iostream> #include <istream> #include <iterator> #include <limits> #include <list> #include <locale> #include <map> #include <memory> #include <new> #include <numeric> #include <ostream> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdexcept> #include <streambuf> #include <string> #include <typeinfo> #include <utility> #include <valarray> #include <vector> #if __cplusplus >= 201103L #include <array> #include <atomic> #include <chrono> #include <condition_variable> #include <forward_list> #include <future> #include <initializer_list> #include <mutex> #include <random> #include <ratio> #include <regex> #include <scoped_allocator> #include <system_error> #include <thread> #include <tuple> #include <typeindex> #include <type_traits> #include <unordered_map> #include <unordered_set> #endif using namespace std; typedef long long ll; //typedef pair<int,int> Pint; typedef pair<ll, ll> P; //typedef pair<ll, pair<ll, ll>> P; //typedef tuple<int,int,int> T; typedef vector<ll> vec; typedef vector<vec> mat; #define rep(i, n) for(ll i = 0; i < n; i++) #define revrep(i, n) for(ll i = n-1; i >= 0; i--) #define pb push_back #define f first #define s second const ll INFL = 1LL << 60;//10^18 = 2^60 const int INF = 1 << 30;//10^9 const ll MOD = 1e9 + 7; const double EPS = 1e-10; //ll MOD = 998244353; vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0}; vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0}; ll max(ll a, ll b){return (a > b) ? a : b;} ll min(ll a, ll b){return (a < b) ? a : b;} ll pow_long(ll x, ll k){ ll res = 1; while(k > 0){ if(k % 2) res *= x; x *= x; k /= 2; } return res; } ll pow_mod(ll x, ll k){ x %= MOD; x += MOD; x %= MOD; ll res = 1; while(k > 0){ if(k % 2){ res *= x; res %= MOD; } x *= x; x %= MOD; k /= 2; } return res; } ll inverse(ll x){return pow_mod(x, MOD - 2);}; ll gcd(ll a, ll b){ if(b == 0) return a; return gcd(b, a % b); } ll lcm(ll x, ll y){return x / gcd(x, y) * y;}; int main(void){ ll H, W; cin >> H >> W; vector<vector<char>> A(H, vector<char>(W)); rep(i, H)rep(j, W) cin >> A[i][j]; if(A[0][0] != '#'){ cout << "Impossoble" << endl; return 0; } A[0][0] = '.'; ll nowh = 0, noww = 0; while(true){ if(nowh == H-1 && noww == W-1){ bool l = 1; rep(i, H)rep(j, W){ if(A[i][j] == '#'){ cout << "Impossible" << endl; return 0; } } cout << "Possible" << endl; return 0; } ll cnt = 0; if(nowh + 1 < H && A[nowh+1][noww] == '#'){ cnt++; } if(noww + 1 < W && A[nowh][noww + 1] == '#'){ cnt++; } if(cnt != 1){ cout << "Impossible" << endl; return 0; } if(nowh + 1 < H && A[nowh+1][noww] == '#'){ A[nowh+1][noww] == '.' nowh++; continue; } if(noww + 1 < W && A[nowh][noww + 1] == '#'){ A[nowh][noww + 1] == '.' noww++; continue; } } }
a.cc: In function 'int main()': a.cc:178:29: error: expected ';' before 'nowh' 178 | A[nowh+1][noww] == '.' | ^ | ; 179 | nowh++; | ~~~~ a.cc:183:31: error: expected ';' before 'noww' 183 | A[nowh][noww + 1] == '.' | ^ | ; 184 | noww++; | ~~~~
s053245144
p03937
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = (int)1e9 + 7; const int INF = (int)100100100; int main() { //ll N; cin >> N; //ll N,M; cin >> N >> M; //string S; cin >> S; ll H,W; cin >> H >> W; ll sum=0 for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ char c; cin >> c; if(c=='#')sum++; } } if(sum==H+W-1)cout << "Possible"; else cout << "impossible"; } /* */
a.cc: In function 'int main()': a.cc:13:5: error: expected ',' or ';' before 'for' 13 | for(int i=0;i<H;i++){ | ^~~ a.cc:13:17: error: 'i' was not declared in this scope 13 | for(int i=0;i<H;i++){ | ^
s851649488
p03937
C++
for(*)
a.cc:1:3: error: expected unqualified-id before 'for' 1 | for(*) | ^~~
s263879579
p03937
C++
#include <iostream> #include <cstring> #include <cmath> #include <algorithm> #include <iomanip> using namespace std; long long int gcd(long long int x, long long int y){ return y!=0 ? gcd(y, x%y) : x; } long long int lcm(long long int x, long long int y){ return x*y/gcd(x, y); } long long int factorial(long long int x){ return x==0 ? 1 : x*factorial(x-1); } int main(){ long long i, j, h, w, ct=-1, tmp=0; cin >> h >>w; a[h][w]; for(i=0; i<h; i++) for(j=0; j<w; j++) cin >> a[i][j]; for(i=0; i<h; i++) for(j=0; j<w; j++){ if(a[i][j]=='#'){ if(i+j==ct+1&&(i==tmp+1||i==tmp)){ ct++; tmp=1; } else{ cout << "Impossible"; return 0; } } } cout << "Possible"; return 0; }
a.cc: In function 'int main()': a.cc:19:3: error: 'a' was not declared in this scope 19 | a[h][w]; | ^
s812724639
p03937
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; int main(){ int h,w; cin>>h>>w; vector<string> a(h); REP(i,h){ cin>>a[i]; } int x=0,y=0; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; bool down=false,right=false; bool flag=true; int nx,ny; map<pair<int,int>> path; path[make_pair(0,0)]++; while(x != h-1 || y != w-1){ down = false;right=false; REP(i,4){ nx = x+dx[i]; ny = y+dy[i]; if(nx<h && ny<w){ if(a[nx][ny]=='.'){ continue; }else{ if(i>=2){ if(path[make_pair(nx,ny)]){ continue; }else{ flag = false; break; } }else{ if(i==0){ down = true; }else{ right = true; } } } } } if(!flag){ break; } if((down && right) || (!down && !right)){ flag = false; break; }else if(down){ path[make_pair(x+1,y)]++; x = x+1; }else{ path[make_pair(x,y+1)]++; y = y+1; } } if(flag){ cout<<"Possible"<<endl; }else{ cout<<"Impossible"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:102:19: error: wrong number of template arguments (1, should be at least 2) 102 | map<pair<int,int>> path; | ^~ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:103:7: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>') 103 | path[make_pair(0,0)]++; | ^ a.cc:114:20: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>') 114 | if(path[make_pair(nx,ny)]){ | ^ a.cc:137:11: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>') 137 | path[make_pair(x+1,y)]++; | ^ a.cc:140:11: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>') 140 | path[make_pair(x,y+1)]++; | ^
s838965135
p03937
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; int main(){ int h,w; cin>>h>>w; vector<string> a(h); REP(i,h){ cin>>a[i]; } int x=0,y=0; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; bool down=false,right=false; bool flag=true; int nx,ny; set<pair<int,int>> path; path.insert(make_pair(0,0)); while(x != h-1 || y != w-1){ down = false;right=false; REP(i,4){ nx = x+dx[i]; ny = y+dy[i]; if(nx<h && ny<w){ if(a[nx][ny]=='.'){ continue; }else{ if(i>=2){ if(path.find(make_pair(nx,ny))){ continue; }else{ flag = false; break; } }else{ if(i==0){ down = true; }else{ right = true; } } } } } if(flag){ break; } if((down && right) || (!down && !right)){ flag = false; break; }else if(down){ path.insert(make_pair(x+1,y)); x = x+1; }else{ path.insert(make_pair(x,y+1)); y = y+1; } } if(flag){ cout<<"Possible"<<endl; }else{ cout<<"Impossible"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:114:25: error: could not convert 'path.std::set<std::pair<int, int> >::find(std::make_pair<int&, int&>(nx, ny))' from 'std::set<std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator'} to 'bool' 114 | if(path.find(make_pair(nx,ny))){ | ~~~~~~~~~^~~~~~~~~~~~~~~~~~ | | | std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator}
s181393352
p03937
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; int main(){ int h,w; cin>>h>>w; vector<string> a(h); REP(i,h){ cin>>a[i]; } int x=0,y=0; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; bool down=false,right=false; bool flag=true; int nx,ny; set<pair<int,int>> path; path.insert(make_pair(0,0)); while(x != h-1 || y != w-1){ down = false;right=false; REP(i,4){ nx = x+dx[i]; ny = y+dy[i]; if(nx<h && ny<w){ if(a[nx][ny]=='.'){ continue; }else{ if(i>=2){ if(s.find(make_pair(nx,ny))){ continue; }else{ flag = false; break; } }else{ if(i==0){ down = true; }else{ right = true; } } } } } if(flag){ break; } if((down && right) || (!down && !right)){ flag = false; break; }else if(down){ set.insert(make_pair(x+1,y)); x = x+1; }else{ set.insert(make_pair(x,y+1)); y = y+1; } } if(flag){ cout<<"Possible"<<endl; }else{ cout<<"Impossible"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:114:16: error: 's' was not declared in this scope 114 | if(s.find(make_pair(nx,ny))){ | ^ a.cc:137:10: error: expected unqualified-id before '.' token 137 | set.insert(make_pair(x+1,y)); | ^ a.cc:140:10: error: expected unqualified-id before '.' token 140 | set.insert(make_pair(x,y+1)); | ^
s636804186
p03937
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namespace std; bool prime(int n){ if(n==1){ return false; }else if(n==2){ return true; }else{ for(int i=2;i<=sqrt(n);i++){ if(n%i==0){ return false; } } return true; } } long long gcd(long long a, long long b){ if(a<b){ swap(a,b); } if(a%b==0){ return b; }else{ return gcd(b,a%b); } } long long lcm(long long x, long long y){ return (x/gcd(x,y))*y; } class UnionFind { public: //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。 vector<int> Parent; //クラスを作るときは、Parentの値を全て-1にする。 //以下のようにすると全てバラバラの頂点として解釈できる。 UnionFind(int N) { Parent = vector<int>(N, -1); } //Aがどのグループに属しているか調べる int root(int A) { if (Parent[A] < 0) return A; return Parent[A] = root(Parent[A]); } //自分のいるグループの頂点数を調べる int size(int A) { return -Parent[root(A)];//先祖をrootで取っておきたい。 } //AとBをくっ付ける bool connect(int A, int B) { //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける A = root(A); B = root(B); if (A == B) { //すでにくっついてるからくっ付けない return false; } //大きい方(A)に小さいほう(B)をくっ付けたい //大小が逆だったらAとBをひっくり返す。 if (size(A) < size(B)) swap(A, B); //Aのサイズを更新する Parent[A] += Parent[B]; //Bの親をAに変更する Parent[B] = A; return true; } }; int main(){ int h,w; cin>>h>>w; vector<string> a(h); REP(i,h){ cin>>a[i]; } int x=0,y=0; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int cnt=0; bool flag=true; int nx,ny; while(x != h-1 || y != w-1){ REP(i,4){ nx = x+dx[i]; ny=y+dy[i]; if(nx<h && ny<w){ if(a[nx][ny]=='.'){ continue; }else{ return 0; }
a.cc: In function 'int main()': a.cc:112:2: error: expected '}' at end of input 112 | } | ^ a.cc:106:23: note: to match this '{' 106 | if(nx<h && ny<w){ | ^ a.cc:112:2: error: expected '}' at end of input 112 | } | ^ a.cc:103:13: note: to match this '{' 103 | REP(i,4){ | ^ a.cc:112:2: error: expected '}' at end of input 112 | } | ^ a.cc:102:30: note: to match this '{' 102 | while(x != h-1 || y != w-1){ | ^ a.cc:112:2: error: expected '}' at end of input 112 | } | ^ a.cc:89:11: note: to match this '{' 89 | int main(){ | ^
s286316561
p03937
Java
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main3 { public static void main(String[] args) { Scanner in = new Scanner(System.in); List<String> input = new ArrayList<String>(); while (in.hasNextLine()) { input.add(in.nextLine()); } in.close(); int y = Integer.parseInt(input.get(0).split(" ")[0]); int x = Integer.parseInt(input.get(0).split(" ")[1]); int count = 0; for (int i = 0; i < y; i++) { for (int j = 0; j < x; j++) { if (input.get(i + 1).charAt(j) == '#') { count++; } } } String str = y + x - 1 == count ? "Possible" : "Impossible"; System.out.println(str); } }
Main.java:5: error: class Main3 is public, should be declared in a file named Main3.java public class Main3 { ^ 1 error
s412378822
p03937
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;} int divCeil(int A, int B) {return (A + (B - 1)) / B;} long long divCeil(long long A, int B) {return (A + (B - 1)) / B;} long long divCeil(int A, long long B) {return (A + (B - 1)) / B;} long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;} int main() { int H, W; cin >> H >> W; vector<int> M(H, 0), m(H, 0); for (int i = 0; i < H; i++) { string S; cin >> S; bool flg = false; for (int j = 0; j < W; j++) { if (S.at(j) == '#') { if (!flg) { m.at(i) = j; flg = true; } else M.at(i) = j; } } } string ans = "Possible"; for (int i = 1; i < N; i++) { if (M.at(i - 1) != m.at(i)) { ans = "Impossible"; break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:39:23: error: 'N' was not declared in this scope 39 | for (int i = 1; i < N; i++) | ^
s849973422
p03937
C++
#include <bits/stdc++.h> using namespace std; const long long mod = pow(10, 9) + 7; const long long MOD = 998244353; const long long INF = 1LL << 60; const int inf = pow(10, 9) + 7; template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;} template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;} int divCeil(int A, int B) {return (A + (B - 1)) / B;} long long divCeil(long long A, int B) {return (A + (B - 1)) / B;} long long divCeil(int A, long long B) {return (A + (B - 1)) / B;} long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;} int main() { int H, W; cin >> H >> W; vector<int> M(H, 0), m(H, 0); for (int i = 0; i < H; i++) { string S; cin >> S; bool flg = false; for (int j = 0; j < W; j++) { if (S.at(j) == '#') { if (!flg) { m.at(i) = j; flg = true; } else M.at(i) = j; } } } string ans = "Possible" for (int i = 1; i < N; i++) { if (M.at(i - 1) != m.at(i)) { ans = "Impossible"; break; } } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:39:3: error: expected ',' or ';' before 'for' 39 | for (int i = 1; i < N; i++) | ^~~ a.cc:39:19: error: 'i' was not declared in this scope 39 | for (int i = 1; i < N; i++) | ^ a.cc:39:23: error: 'N' was not declared in this scope 39 | for (int i = 1; i < N; i++) | ^
s561476729
p03937
C
include<stdio.h> #include<stdlib.h> #include<stdint.h> #include<inttypes.h> typedef int32_t i32; typedef int64_t i64; #define MIN(a,b) ((a) < (b) ? (a) : (b)) void run (void) { i32 n, e, t; scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &n, &e, &t); i32 *x = (i32 *) calloc (n + 2, sizeof (i32)); for (i32 i = 1; i <= n; ++i) { scanf ("%" SCNi32, x + i); } x[n + 1] = e; i64 *dp = (i64 *) calloc (n + 1, sizeof (i64)); i64 min = (i64) n * t + e; for (i32 i = 1, j = 1; i <= n; ++i) { dp[i] = dp[i - 1] + x[i] - x[i - 1] + t; for (; 2 * (x[i] - x[j]) >= t; ++j) { min = MIN(min, dp[j - 1] + x[j] - x[j - 1] - (i64) 3 * x[j]); } dp[i] = MIN(dp[i], min + (i64) 3 * x[i]); if (j < i) { i64 p = dp[j - 1] + x[j] - x[j - 1]; p += t; p += x[i] - x[j]; dp[i] = MIN(dp[i], p); } } printf("%" PRIi64 "\n", dp[n] + e - x[n]); } int main (void) { run(); return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/stdlib.h:98:8: error: unknown type name 'size_t' 98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur; | ^~~~~~ /usr/include/stdlib.h:57:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 56 | #include <bits/floatn.h> +++ |+#include <stddef.h> 57 | /usr/include/stdlib.h:531:25: error: unknown type name 'size_t' 531 | size_t __statelen) __THROW __nonnull ((2)); | ^~~~~~ /usr/include/stdlib.h:531:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:561:25: error: unknown type name 'size_t' 561 | size_t __statelen, | ^~~~~~ /usr/include/stdlib.h:561:25: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:661:42: error: unknown type name 'size_t' 661 | extern void arc4random_buf (void *__buf, size_t __size) | ^~~~~~ /usr/include/stdlib.h:661:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:672:22: error: unknown type name 'size_t' 672 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:672:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:22: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:675:38: error: unknown type name 'size_t' 675 | extern void *calloc (size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:675:38: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:683:36: error: unknown type name 'size_t' 683 | extern void *realloc (void *__ptr, size_t __size) | ^~~~~~ /usr/include/stdlib.h:683:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:41: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:695:57: error: unknown type name 'size_t' 695 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:695:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:41: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:41: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:701:57: error: unknown type name 'size_t' 701 | extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) | ^~~~~~ /usr/include/stdlib.h:701:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/stdlib.h:706: /usr/include/alloca.h:32:22: error: unknown type name 'size_t' 32 | extern void *alloca (size_t __size) __THROW; | ^~~~~~ /usr/include/alloca.h:25:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 24 | #include <stddef.h> +++ |+#include <stddef.h> 25 | /usr/include/stdlib.h:712:22: error: unknown type name 'size_t' 712 | extern void *valloc (size_t __size) __THROW __attribute_malloc__ | ^~~~~~ /usr/include/stdlib.h:712:22: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:45: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:718:65: error: unknown type name 'size_t' 718 | extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:718:65: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:29: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:29: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:724:49: error: unknown type name 'size_t' 724 | extern void *aligned_alloc (size_t __alignment, size_t __size) | ^~~~~~ /usr/include/stdlib.h:724:49: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:23: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:961:39: error: unknown type name 'size_t' 961 | size_t __nmemb, size_t __size, __compar_fn_t __compar) | ^~~~~~ /usr/include/stdlib.h:961:39: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:34: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:34: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:970:50: error: unknown type name 'size_t' 970 | extern void qsort (void *__base, size_t __nmemb, size_t __size, | ^~~~~~ /usr/include/stdlib.h:970:50: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1044:20: error: unknown type name 'size_t' 1044 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1044:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1047:20: error: unknown type name 'size_t' 1047 | size_t __len) __THROW __nonnull ((3, 4, 5)); | ^~~~~~ /usr/include/stdlib.h:1047:20: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1051:45: error: unknown type name 'size_t' 1051 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1051:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1055:45: error: unknown type name 'size_t' 1055 | char *__restrict __buf, size_t __len) | ^~~~~~ /usr/include/stdlib.h:1055:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1062:36: error: unknown type name 'size_t' 1062 | extern int mblen (const char *__s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1062:36: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1066:48: error: unknown type name 'size_t' 1066 | const char *__restrict __s, size_t __n) __THROW; | ^~~~~~ /usr/include/stdlib.h:1066:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1073:8: error: unknown type name 'size_t' 1073 | extern size_t mbstowcs (wchar_t *__restrict __pwcs, | ^~~~~~ /usr/include/stdlib.h:1073:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1074:53: error: unknown type name 'size_t' 1074 | const char *__restrict __s, size_t __n) __THROW | ^~~~~~ /usr/include/stdlib.h:1074:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/stdlib.h:1077:8: error: unknown type name 'size_t' 1077 | extern size_t wcstombs (char *__restrict __s, | ^~~~~~ /usr/include/stdlib.h:1077:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably
s562490057
p03937
C++
#include <<bits/stdc++.h> using namespace std; int main() { int h, w; cin >> h >> w; vector<string> s(h); for(int i = 0; i < h; i++) { cin >> s[i]; } int c = 0; for(int i = 0; i < h; i++) { for(int j = 0; j < w; j++) { if(s[i][j] == '#') c++; } } if(c == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc:1:10: fatal error: <bits/stdc++.h: No such file or directory 1 | #include <<bits/stdc++.h> | ^~~~~~~~~~~~~~~~ compilation terminated.
s221066743
p03937
C++
#include <iostream> #include <vector> using namespace std; int main(){ int h, w; cin >> h >> w; vector<vector<char>>a(h+2, vector<int>(w+2, '.')); for(int i=1; i<=h; i++)for(int j=1; j<=w; j++)cin >> a[i][j]; int x=1, y=1; for(int i=0; i<2n; i++){#include <iostream> #include <vector> using namespace std; int main(){ int h, w; cin >> h >> w; vector<vector<bool>>chk(h+2, vector<bool>(w+2, false)); vector<vector<char>>a(h+2, vector<char>(w+2, '.')); for(int i=1; i<=h; i++)for(int j=1; j<=w; j++)cin >> a[i][j]; int x=1, y=1; chk[x][y]=true; for(int i=0; i<h+w; i++){ if(i%2==0)while(a[x+1][y]=='#'){x++; chk[x][y]=true;} if(i%2==0)while(a[x][y+1]=='#'){y++; chk[x][y]=true;} } if(!(x==h && y==w)){cout << "Impossible"; return 0;} for(int i=1; i<=h; i++)for(int j=1; j<=w; j++)if(a[i][j]=='#' && (!chk[i][j])){cout << "Impossible"; return 0;} cout << "Possible"; return 0; } if(i%2==0)while(a[x+1][y]=='#')x++; if(i%2==0)while(a[x][y+1]=='#')y++; } if(x==n && y==n)cout << "Possible"; else cout << "Impossible"; }
a.cc:11:27: error: stray '#' in program 11 | for(int i=0; i<2n; i++){#include <iostream> | ^ a.cc: In function 'int main()': a.cc:8:51: error: no matching function for call to 'std::vector<std::vector<char> >::vector(int, std::vector<int>)' 8 | vector<vector<char>>a(h+2, vector<int>(w+2, '.')); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]' 707 | vector(_InputIterator __first, _InputIterator __last, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed: a.cc:8:51: note: deduced conflicting types for parameter '_InputIterator' ('int' and 'std::vector<int>') 8 | vector<vector<char>>a(h+2, vector<int>(w+2, '.')); | ^ /usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >]' 678 | vector(initializer_list<value_type> __l, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<char> >' 678 | vector(initializer_list<value_type> __l, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<char> >]' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<char> >&&' 659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m) | ~~~~~~~~~^~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >; std::false_type = std::false_type]' 640 | vector(vector&& __rv, const allocator_type& __m, false_type) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >; std::true_type = std::true_type]' 635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<char> >]' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<char> >&' 624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]' 620 | vector(vector&&) noexcept = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]' 601 | vector(const vector& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; size_type = long unsigned int; value_type = std::vector<char>; allocator_type = std::allocator<std::vector<char> >]' 569 | vector(size_type __n, const value_type& __value, | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<char> >::value_type&' {aka 'const std::vector<char>&'} 569 | vector(size_type __n, const value_type& __value, | ~~~~~~~~~~~~~~~~~~^~~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<char> >]' 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'std::vector<int>' to 'const std::vector<std::vector<char> >::allocator_type&' {aka 'const std::allocator<std::vector<char> >&'} 556 | vector(size_type __n, const allocator_type& __a = allocator_type()) | ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >; allocator_type = std::allocator<std::vector<char> >]' 542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<char>; _Alloc = std::allocator<std::vector<char> >]' 531 | vector() = default; | ^~~~~~ /usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided a.cc:11:18: error: unable to find numeric literal operator 'operator""n' 11 | for(int i=0; i<2n; i++){#include <iostream> | ^~ a.cc:11:28: error: 'include' was not declared in this scope 11 | for(int i=0; i<2n; i++){#include <iostream> | ^~~~~~~ a.cc:11:45: error: expected primary-expression before '>' token 11 | for(int i=0; i<2n; i++){#include <iostream> | ^ a.cc:13:1: error: expected primary-expression before 'using' 13 | using namespace std; | ^~~~~ a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 15 | int main(){ | ^~ a.cc:15:9: note: remove parentheses to default-initialize a variable 15 | int main(){ | ^~ | -- a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable a.cc:15:11: error: a function-definition is not allowed here before '{' token 15 | int main(){ | ^ a.cc:35:9: error: 'n' was not declared in this scope 35 | if(x==n && y==n)cout << "Possible"; | ^
s627006070
p03937
C++
#include<bits/stdc++.h> using namespace std; int a[10][10],m,n,flag; char kk[10]; void dfs(int x,int y){ if(x==m-1&&y==n-1){ for(int i=0;i<m;++i)for(int j=0;j<n;++j)if(a[i][j])return; flag = 1; return; } if(flag==1)return; if(a[x+1][y]){ a[x+1][y]=0; dfs(x+1,y); a[x+1][y]=1; } if(a[x][y+1]){ a[x][y+1]=0; dfs(x,y+1); a[x][y+1]=1; } if(!a[x][y+1]&&!a[x+1][y])return; } int main(){ scanf("%d%d",&m,&n); for(int i=0;i<=m;++i){ gets(kk); for(int j=0;j<n;++j)if(kk[j]=='#')a[i-1][j]=1; } if(a[0][0]){ a[0][0]=0; dfs(0,0); } if(flag)cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 27 | gets(kk); | ^~~~ | getw
s578568481
p03937
C++
#include<bits/stdc++.h> using namespace std; int a[10][10],m,n,flag; char kk[10]; void dfs(int x,int y){ if(x==m-1&&y==n-1){ for(int i=0;i<m;++i)for(int j=0;j<n;++j)if(a[i][j])return; flag = 1; return; } if(flag==1)return; if(a[x+1][y]){ a[x+1][y]=0; dfs(x+1,y); a[x+1][y]=1; } if(a[x][y+1]){ a[x][y+1]=0; dfs(x,y+1); a[x][y+1]=1; } if(!a[x][y+1]&&!a[x+1][y])return; } int main(){ scanf("%d%d",&m,&n); for(int i=0;i<=m;++i){ gets(kk); for(int j=0;j<n;++j)if(kk[j]=='#')a[i-1][j]=1; } if(a[0][0]){ a[0][0]=0; dfs(0,0); } if(flag)cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:27:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 27 | gets(kk); | ^~~~ | getw
s587213804
p03937
C++
#include <bits/stdc++.h> using namespace std; int a[10][10],m,n,flag; char kk[10]; void dfs(int x,int y){ if(x == m-1 && y == n-1){ for(int i = 0;i < m;++i) for(int j = 0;j < n;++j){ if(a[i][j]) return; } flag = 1; return; } if(flag == 1) return; if(a[x+1][y]){ a[x+1][y] = 0; dfs(x+1,y); a[x+1][y] = 1; } if(a[x][y+1]){ a[x][y+1] = 0; dfs(x,y+1); a[x][y+1] = 1; } if(!a[x][y+1] && !a[x+1][y]) return; } int main(){ scanf("%d%d",&m,&n); for(int i=0;i<=m;++i){ gets(kk); for(int j=0;j<n;++j) if(kk[j]=='#')a[i-1][j] = 1; } if(a[0][0]){ a[0][0] = 0; dfs(0,0); } if(flag)cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'int main()': a.cc:30:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 30 | gets(kk); | ^~~~ | getw
s929294719
p03937
C++
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int h,w; cin>>h>>w; char masu[h][w]; rep(i, h){ rep(j, w){ cin>>masu[i][j]; } } bool imp=false; rep(i, h){ rep(j, w){ if(masu[i][j]=='#'){ if(i!=h-1||j!=w-1){ if(masu[i+1][j]=="."&&masu[i][j+1]=="."){ imp=true;} } else if(i==h-1||j!=w-1){ if(masu[i][j+1]=="."){ imp=true;} } else if(i!=h-1||j==w-1){ if(masu[i+1][j]=="."){ imp=true;} } } } if(imp=true) cout<<"Impossible"<<endl; else cout<<"Possible"<<endl; }
a.cc: In function 'int main()': a.cc:20:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(masu[i+1][j]=="."&&masu[i][j+1]=="."){ | ~~~~~~~~~~~~^~~~~ a.cc:20:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 20 | if(masu[i+1][j]=="."&&masu[i][j+1]=="."){ | ~~~~~~~~~~~~^~~~~ a.cc:24:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 24 | if(masu[i][j+1]=="."){ | ~~~~~~~~~~~~^~~~~ a.cc:28:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 28 | if(masu[i+1][j]=="."){ | ~~~~~~~~~~~~^~~~~ a.cc:39:2: error: expected '}' at end of input 39 | } | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s322390730
p03937
C++
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int h,w cin>>h>>w; char masu[h][w]; rep(i, h){ rep(j, w){ cin>>masu[i][j]; } } bool imp=false; rep(i, h){ rep(j, w){ if(masu[i][j]=='#'){ if(i!=h-1||j!=w-1){ if(masu[i+1][j]=="."&&masu[i][j+1]=="."){ imp=true;} } else if(i==h-1||j!=w-1){ if(masu[i][j+1]=="."){ imp=true;} } else if(i!=h-1||j==w-1){ if(masu[i+1][j]=="."){ imp=true;} } } } if(imp=true) cout<<"Impossible"<<endl; else cout<<"Possible"<<endl; }
a.cc: In function 'int main()': a.cc:8:11: error: expected initializer before 'cin' 8 | int h,w cin>>h>>w; | ^~~ a.cc:9:16: error: 'w' was not declared in this scope 9 | char masu[h][w]; | ^ a.cc:12:12: error: 'masu' was not declared in this scope 12 | cin>>masu[i][j]; | ^~~~ a.cc:18:10: error: 'masu' was not declared in this scope 18 | if(masu[i][j]=='#'){ | ^~~~ a.cc:39:2: error: expected '}' at end of input 39 | } | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s465043419
p03937
C++
#include <bits/stdc++.h> #define ALL(v) v.begin(), v.end() #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; typedef long long ll; int main() { int h,w cin>>h>>w; char masu[h][w]; rep(i, h){ rep(j, w){ cin>>masu[i][j] } } bool imp=false; rep(i, h){ rep(j, w){ if(masu[i][j]=='#'){ if(i!=h-1||j!=w-1){ if(masu[i+1][j]=="."&&masu[i][j+1]=="."){ imp=true;} } else if(i==h-1||j!=w-1){ if(masu[i][j+1]=="."){ imp=true;} } else if(i!=h-1||j==w-1){ if(masu[i+1][j]=="."){ imp=true;} } } } if(imp=true) cout<<"Impossible"<<endl; else cout<<"Possible"<<endl; }
a.cc: In function 'int main()': a.cc:8:11: error: expected initializer before 'cin' 8 | int h,w cin>>h>>w; | ^~~ a.cc:9:16: error: 'w' was not declared in this scope 9 | char masu[h][w]; | ^ a.cc:12:12: error: 'masu' was not declared in this scope 12 | cin>>masu[i][j] | ^~~~ a.cc:18:10: error: 'masu' was not declared in this scope 18 | if(masu[i][j]=='#'){ | ^~~~ a.cc:39:2: error: expected '}' at end of input 39 | } | ^ a.cc:7:12: note: to match this '{' 7 | int main() { | ^
s944590825
p03937
C++
#include<iostream> using namespace std; int main(){ int cnt=0,c,h,w; cin>>h>>w; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>c; if(c=='#')cnt++; } } cout<<(cnt=h+w-1 ? "Possible" : "Impossible")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:12:20: error: invalid conversion from 'const char*' to 'int' [-fpermissive] 12 | cout<<(cnt=h+w-1 ? "Possible" : "Impossible")<<endl; | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | const char*
s038442445
p03937
C++
#include<iostream> using namespace std; int main(){ int cnt=0,h,w; cin>>h>>w; for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>c; if(c=='#')cnt++; } } cout<<(h+w-1=cnt ? "Possible" : "Impossible")<<endl; return 0; }
a.cc: In function 'int main()': a.cc:8:12: error: 'c' was not declared in this scope 8 | cin>>c; | ^ a.cc:12:13: error: lvalue required as left operand of assignment 12 | cout<<(h+w-1=cnt ? "Possible" : "Impossible")<<endl; | ~~~^~
s392732196
p03937
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll INF = 1LL<<60; int main() { int h,w; cin >> h >> w; int count = 0; char A[h][w]; rep(i,h){ rep(j, w){ cin >> A[i][j]; if(map[i][j] = '#') count++; } } if(count == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:29:15: error: expected unqualified-id before '[' token 29 | if(map[i][j] = '#') count++; | ^
s281289267
p03937
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll INF = 1LL<<60; int main() { int h,w; cin >> h >> w; int count = 0; vector<vector<char>> A(h, (vector<char>(w))); rep(i,h){ rep(j, w){ cin >> A[i][j]; if(map[i][j] = '#') count++; } } if(count == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:29:15: error: expected unqualified-id before '[' token 29 | if(map[i][j] = '#') count++; | ^
s631081286
p03937
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll INF = 1LL<<60; int main() { int h,w; cin >> h >> w; int count = 0; vector<vector<char>> map(h, (vector<char>(w)); rep(i,h){ rep(j, w){ cin >> map[i][j]; } } rep(i,h){ rep(j, w){ if(map[i][j] = '#') count++; } } if(count == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:25:54: error: expected ')' before ';' token 25 | vector<vector<char>> map(h, (vector<char>(w)); | ~ ^ | )
s691339692
p03937
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll INF = 1LL<<60; int main() { int h,w; cin >> h >> w; int count = 0; vector<vector<string>> map(h, (vector<string>(w)); rep(i,h){ rep(j, w){ cin >> map[i][j]; } } rep(i,h){ rep(j, w){ if(map[i][j] = "#") count++; } } if(count == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:25:58: error: expected ')' before ';' token 25 | vector<vector<string>> map(h, (vector<string>(w)); | ~ ^ | ) a.cc:33:22: error: could not convert '(&(& map.std::vector<std::vector<std::__cxx11::basic_string<char> > >::operator[](((std::vector<std::vector<std::__cxx11::basic_string<char> > >::size_type)i)))->std::vector<std::__cxx11::basic_string<char> >::operator[](((std::vector<std::__cxx11::basic_string<char> >::size_type)j)))->std::__cxx11::basic_string<char>::operator=(((const char*)"#"))' from 'std::__cxx11::basic_string<char>' to 'bool' 33 | if(map[i][j] = "#") count++;
s060081349
p03937
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) using namespace std; #define sz(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define MEMSET(v, h) memset((v), h, sizeof(v)) template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } #define pb push_back #define mp make_pair #define y0 y3487465 #define y1 y8687969 #define j0 j1347829 #define j1 j234892 ll gcd(ll a,ll b){return b?gcd(b,a%b):a;} const ll INF = 1LL<<60; int main() { int h,w; cin >> h >> w; int count = 0; vector<vector<string>> map(h, (vector<string>(w)); rep(i,h){ rep(j, w){ cin >> map[i][j]; } } rep(i,h){ rep(j, w){ if(map[i][j] = '#') count++; } } if(count == h + w - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:25:58: error: expected ')' before ';' token 25 | vector<vector<string>> map(h, (vector<string>(w)); | ~ ^ | ) a.cc:33:22: error: could not convert '(&(& map.std::vector<std::vector<std::__cxx11::basic_string<char> > >::operator[](((std::vector<std::vector<std::__cxx11::basic_string<char> > >::size_type)i)))->std::vector<std::__cxx11::basic_string<char> >::operator[](((std::vector<std::__cxx11::basic_string<char> >::size_type)j)))->std::__cxx11::basic_string<char>::operator=(35)' from 'std::__cxx11::basic_string<char>' to 'bool' 33 | if(map[i][j] = '#') count++;
s852297062
p03937
C++
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <unordered_map> #include <utility> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <cstdio> using namespace std; #define REP(i,n,m) for( long long int i = (n); i < (m); i++ ) #define ll long long #define ALL(a) (a).begin(), (a).end() #define SORT(v) sort( ALL(v) ); #define LAST(v) v[v.size()-1] #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,-1,sizeof(a)) #define pi pair<int, int> #define MP make_pair #define PB push_back #define IIN(a) int a; cin >> a; #define LIN(a) ll a; cin >> a; #define SIN(a) string a; cin >> a; #define EPS (1e-10) #define INF 1000000000000LL int MOD=1000000007; int dx[2] = {0, 1}; int dy[2] = {1, 0}; //I ASCII code: '0' = 48; 'A' = 65; 'a' = 97 ll h, w; char grid[w][h]; signed main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> h >> w; int cnt = 0; REP( i, 0, h ){ REP( i, 0, w){ cin >> grid[i][j]; if( grid[i][j] == '#') cnt++; } } cout << ( ( cnt == h + w - 1 ) ? "Possible" : "Impossible") << endl; return 0; }
a.cc:42:14: error: size of array 'grid' is not an integral constant-expression 42 | char grid[w][h]; | ^ a.cc:42:11: error: size of array 'grid' is not an integral constant-expression 42 | char grid[w][h]; | ^ a.cc: In function 'int main()': a.cc:53:24: error: 'j' was not declared in this scope 53 | cin >> grid[i][j]; | ^
s823047477
p03937
C++
#include <bits/stdc++.h> using namespace std; int main() { int h,w; cin>>h>>w; char a; int ans=0:; for(int i=0;i<h;i++) for(int j=0;j<w;j++){ cin>>a; if(a=='#') ans++; } if(ans==h+w-1) cout<<"Possible"; else cout<<"Impossible"; }
a.cc: In function 'int main()': a.cc:8:12: error: expected ',' or ';' before ':' token 8 | int ans=0:; | ^
s458309381
p03937
C++
#include <stdio.h> using namespace std; int main(){ int H,W; cin >> H >> W; char a[H][W]; int ans=0; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ cin >> a[i][j]; if(a[i][j]=='#')ans++; } } if(ans==H+W-1)cout << "Possible" << endl; else cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin >> H >> W; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <stdio.h> +++ |+#include <iostream> 2 | using namespace std; a.cc:14:17: error: 'cout' was not declared in this scope 14 | if(ans==H+W-1)cout << "Possible" << endl; | ^~~~ a.cc:14:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:14:39: error: 'endl' was not declared in this scope 14 | if(ans==H+W-1)cout << "Possible" << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <stdio.h> +++ |+#include <ostream> 2 | using namespace std; a.cc:15:8: error: 'cout' was not declared in this scope 15 | else cout << "Impossible" << endl; | ^~~~ a.cc:15:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:15:32: error: 'endl' was not declared in this scope 15 | else cout << "Impossible" << endl; | ^~~~ a.cc:15:32: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s750872197
p03937
C++
#include <iostream> using namespace std; using uint = unsigned int; using ll = long long; using ull = unsigned long long; #include <string> #include <cstdio> #include <algorithm> #include <vector> #include <cmath> #include <climits> #include <bitset> #include <array> #include <deque> #include <queue> #include <map> #include <set> #define all(x) (x).begin(),(x).end() const int MOD = 1e9 + 7; void solve(){ } int main(){ int H,W; cin >> H >> W; string A(H); for (int i = 0; i < H; ++i) { cin >> A[i]; } int cnt = 0; for (int i = 0; i < H; ++i) { for (int k = 0; k < W; ++k) { if (A[i][k] == '#') { cnt++; } } } if (cnt == H+W-1) { cout << "Possible" << endl; } else { cout << "Impossible" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:15: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(int&)' 29 | string A(H); | ^ In file included from /usr/include/c++/14/string:54, 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/basic_string.h:800:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 800 | basic_string(const _Tp& __t, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:800:9: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/bits/move.h:37, from /usr/include/c++/14/bits/exception_ptr.h:41, from /usr/include/c++/14/exception:166, from /usr/include/c++/14/ios:41: /usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = void]': /usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = int; _Res = void; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 149 | using _If_sv = enable_if_t< | ^~~~~~ /usr/include/c++/14/bits/basic_string.h:797:30: required from here 797 | template<typename _Tp, typename = _If_sv<_Tp, void>> | ^~~~~~~~ /usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, void>' 2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type; | ^~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate: 'template<class _Tp, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Tp&, size_type, size_type, const _Alloc&) [with <template-parameter-2-2> = _Tp; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 788 | basic_string(const _Tp& __t, size_type __pos, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:788:9: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(_InputIterator, _InputIterator, const _Alloc&) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 765 | basic_string(_InputIterator __beg, _InputIterator __end, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:765:9: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(size_type, _CharT, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 669 | basic_string(size_type __n, _CharT __c, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:669:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:646:7: note: candidate: 'template<class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 646 | basic_string(const _CharT* __s, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:646:7: note: template argument deduction/substitution failed: a.cc:29:14: note: cannot convert 'H' (type 'int') to type 'const char*' 29 | string A(H); | ^ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 721 | basic_string(basic_string&& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:721:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 716 | basic_string(const basic_string& __str, const _Alloc& __a) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:716:7: note: candidate expects 2 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:711:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::initializer_list<_Tp>, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:711:45: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<char>' 711 | basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc()) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_string.h:682:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 682 | basic_string(basic_string&& __str) noexcept | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:682:35: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>&&' 682 | basic_string(basic_string&& __str) noexcept | ~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 624 | basic_string(const _CharT* __s, size_type __n, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:624:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 604 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:604:7: note: candidate expects 4 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 586 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:586:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' 569 | basic_string(const basic_string& __str, size_type __pos, | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:569:7: note: candidate expects 3 arguments, 1 provided /usr/include/c++/14/bits/basic_string.h:552:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 552 | basic_string(const basic_string& __str) | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:552:40: note: no known conversion for argument 1 from 'int' to 'const std::__cxx11::basic_string<char>&' 552 | basic_string(const basic_string& __str) | ~~~~~~~~~~~~~~~~~~~~^~~~~ /usr/include/c++/14/bits/basic_string.h:540:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ^~~~~~~~~~~~ /usr/include/c++/14/bits/basic_string.h:540:34: note: no known conversion for argument 1 from 'int' to 'const std::allocator<char>&' 540 | basic_string(const _Alloc& __a) _GLIBCXX_NOEXCEPT | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/basic_
s614504799
p03937
C++
#include <cstring> #include <cstdio> #include <algorithm> #include <iostream> #include <vector> #include <map> #include <unordered_map> #include <cmath> #include <queue> #include <set> #include <stack> using namespace std; typedef long long ll; typedef pair<int, int> P; #define rep(i, n) for(ll i = 0; i < (ll)(n); i++) #define repr(i, n) for(ll i = n - 1; i >= 0; i--) #define repone(i, n) for(ll i = 1; i <= (ll)(n); i++) #define each(i, mp) for(auto i:mp) #define FOR(i, m, n) for(ll i = m;i < n;i++) const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; const ll mod = 1000000007; const ll inf = ll(1e9); const ll half_inf = ll(1e5); const ll ll_inf = ll(1e9) * ll(1e9); ll h, w; char a[8][8]; bool seen[8][8]; bool dfs(int i, int j) { seen[i][j] = true; if (i - 1 >= 0 && a[i - 1][j] == '#' && !seen[i - 1][j]) return false; if (j - 1 >= 0 && a[i][j - 1] == '#' && !seen[i][j - 1]) return false; if (i == h - 1 && j == w - 1) return true; if (i + 1 <= h - 1 && a[i + 1][j] == '#' && j + 1 < w - 1 && a[i][j + 1] == '#') return false; if (i + 1 <= h - 1 && a[i + 1][j] == '#') if (dfs(i + 1, j)) return true; if (j + 1 <= w - 1 && a[i][j + 1] == '#') if (dfs(i, j + 1)) return true; return false; } void solve() { fill(seen, seen + 8, false); if (dfs(0, 0)) cout << "Possible" << endl; else cout << "Impossible" << endl; } int main() { cin >> h >> w; rep(i, h) rep(j, w) cin >> a[i][j]; solve(); return 0; }
In file included from /usr/include/c++/14/algorithm:60, from a.cc:3: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[8]; _Tp = bool; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]': /usr/include/c++/14/bits/stl_algobase.h:998:21: required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = bool (*)[8]; _Tp = bool]' 998 | { std::__fill_a1(__first, __last, __value); } | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:1029:20: required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = bool (*)[8]; _Tp = bool]' 1029 | std::__fill_a(__first, __last, __value); | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:45:9: required from here 45 | fill(seen, seen + 8, false); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algobase.h:952:18: error: incompatible types in assignment of 'const bool' to 'bool [8]' 952 | *__first = __tmp; | ~~~~~~~~~^~~~~~~
s971260142
p03937
C++
#include<cstdio> using namespace std; int main(){ int h,w,g[8][8]={},l=0,flag=1; char s[8][10]; scanf("%d %d",&h,&w); for(int i=0;i<h;i++) scanf("%s",s[i]); g[0][0]=1; for(int i=0;i<h;i++) for(;l<w;l++){ if(j!=w-1&&g[i][j]&&s[i][j+1]=='#'){ g[i][j+1]=1; } else if(i!=h-1&&g[i][j]&&s[i+1][j]=='#'){ g[i+1][j]=1; break; } } for(int i=0;i<h;i++) for(int j=0;j<w;j++) if(s[i][j]=='#'&&g[i][j]==0) flag=0; if(flag) printf("Possible\n"); else printf("Impossible\n"); }
a.cc: In function 'int main()': a.cc:12:10: error: 'j' was not declared in this scope 12 | if(j!=w-1&&g[i][j]&&s[i][j+1]=='#'){ | ^
s230466224
p03937
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; int main() { int h, w; cin >> h >> w; int sharp = 0; for(int i = 0; i < n; i++){ char t; cin >> t; if(t=='#'){sharp++;} } if(sharp == h+w-1){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:24: error: 'n' was not declared in this scope 11 | for(int i = 0; i < n; i++){ | ^
s870059226
p03937
C++
#include "bits/stdc++.h" #define rep(i,a,n) for(int i = (a);i <(n);i++) using namespace std; int main(){ int n,m,x=0,y=0; char cell[10][10]; cin >> n >> m; rep(i,0,10){ rep(j,0,10){ cell[i][j] = 'X'; } } rep(i,0,n){ rep(j,0,m){ cin >> cell[i][j]; } } while(1){ if(cell[x+1][y] == '#'){ cell[x][y] = '.' x++; } else if(cell[x][y+1] == '#'){ cell[x][y] = '.' y++; } else{ break; } } rep(i,0,n){ rep(j,0,m){ if(cell[i][j] == '#'){ cout << "Impossible" << endl; return 0; } } } cout << "Possible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:24:23: error: expected ';' before 'x' 24 | cell[x][y] = '.' | ^ | ; 25 | x++; | ~ a.cc:28:23: error: expected ';' before 'y' 28 | cell[x][y] = '.' | ^ | ; 29 | y++; | ~
s088517361
p03937
C++
#include "bits/stdc++.h" #define rep(i,a,n) for(int i = (a);i <(n);i++) using namespace std; int main(){ int n,m,x=0,y=0; char cell cell[10][10]; cin >> n >> m; rep(i,0,10){ rep(j,0,10){ cell[i][j] = 'X'; } } rep(i,0,n){ rep(j,0,m){ cin >> cell[i][j]; } } while(1){ if(cell[x+1][y] == '#'){ x++; } else if(cell[x][y+1] == '#'){ y++; } else{ break; } } rep(i,0,n){ rep(j,0,m){ if(cell[i][j] == '#'){ cout << "Impossible" << endl; return 0; } } } cout << "Possible" << endl; return 0; }
a.cc:7:8: error: extended character   is not valid in an identifier 7 | char cell cell[10][10]; | ^ a.cc: In function 'int main()': a.cc:12:7: error: 'cell' was not declared in this scope; did you mean 'ceill'? 12 | cell[i][j] = 'X'; | ^~~~ | ceill a.cc:18:14: error: 'cell' was not declared in this scope; did you mean 'ceill'? 18 | cin >> cell[i][j]; | ^~~~ | ceill a.cc:23:8: error: 'cell' was not declared in this scope; did you mean 'ceill'? 23 | if(cell[x+1][y] == '#'){ | ^~~~ | ceill a.cc:36:10: error: 'cell' was not declared in this scope; did you mean 'ceill'? 36 | if(cell[i][j] == '#'){ | ^~~~ | ceill
s101458333
p03937
C++
#include "bits/stdc++.h" using namespace std; int main(){ int n,m,x=0,y=0; char cell cell[10][10]; cin >> n >> m; rep(i,0,10){ rep(j,0,10){ cell[i][j] = 'X'; } } rep(i,0,n){ rep(j,0,m){ cin >> cell[i][j]; } } while(1){ if(cell[x+1][y] == '#'){ x++; } else if(cell[x][y+1] == '#'){ y++; } else{ break; } } rep(i,0,n){ rep(j,0,m){ if(cell[i][j] == '#'){ cout << "Impossible" << endl; return 0; } } } cout << "Possible" << endl; return 0; }
a.cc:6:8: error: extended character   is not valid in an identifier 6 | char cell cell[10][10]; | ^ a.cc: In function 'int main()': a.cc:9:7: error: 'i' was not declared in this scope 9 | rep(i,0,10){ | ^ a.cc:9:3: error: 'rep' was not declared in this scope 9 | rep(i,0,10){ | ^~~ a.cc:22:8: error: 'cell' was not declared in this scope; did you mean 'ceill'? 22 | if(cell[x+1][y] == '#'){ | ^~~~ | ceill
s802796820
p03937
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int H = sc.nextInt(); int W = sc.nextInt(); String[] dic = new String[H]; for(int i=0;i<H;i++) dic[i]=sc.next(); int end = -1; for(int i=0;i<H;i++){ int left = 0; while(dic[i].charAt(left)=='.') left++; if(end>left){ System.out.println("Impossible"); System.exit(0); } end = 4; whlie(dic[i].charAt(end)=='.') end++; } System.out.println("Possible"); } }
Main.java:19: error: ';' expected whlie(dic[i].charAt(end)=='.') end++; ^ 1 error
s703316571
p03937
C++
use std::io::*; use std::str::FromStr; fn main() { let h: usize = read(); let w: usize = read(); let mut a: Vec<Vec<char>> = (0..h).map(|_| read::<String>().chars().collect()).collect(); let mut x = 0; let mut y = 0; let mut check = true; while x != w - 1 || y != h - 1 { let po1 = x < w - 1 && a[y][x + 1] == '#'; let po2 = y < h - 1 && a[y + 1][x] == '#'; if (po1 && po2) || (x > 0 && a[y][x - 1] == '#') || (y > 0 && a[y - 1][x] == '#') { check = false; break; } a[y][x] = '.'; if po1 { x += 1; } if po2 { y += 1; } } println!("{}", if check { "Possible" } else { "Impossible" }); } fn read<T: FromStr>() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") }
a.cc:7:34: error: too many decimal points in number 7 | let mut a: Vec<Vec<char>> = (0..h).map(|_| read::<String>().chars().collect()).collect(); | ^~~~ a.cc:1:1: error: 'use' does not name a type 1 | use std::io::*; | ^~~ a.cc:2:1: error: 'use' does not name a type 2 | use std::str::FromStr; | ^~~ a.cc:4:1: error: 'fn' does not name a type 4 | fn main() { | ^~ a.cc:30:1: error: 'fn' does not name a type 30 | fn read<T: FromStr>() -> T { | ^~
s877013187
p03937
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, e, t; cin>>n>>e>>t; if(n > 2004) return; ll a[n]; for(int i = 0; i < n; i++) cin>>a[i]; ll dp[n+1]; dp[n] = 0; for(int i = n-1; i >= 0; i--){ dp[i] = dp[i+1] + t; for(int j = i+1; j < n; j++){ dp[i] = min(dp[i], dp[j+1] + max(2*(a[j]-a[i]), t)); } } cout<<dp[0] + e<<endl; }
a.cc: In function 'int main()': a.cc:7:22: error: return-statement with no value, in function returning 'int' [-fpermissive] 7 | if(n > 2004) return; | ^~~~~~
s195026905
p03937
C++
#include <bits/stdc++.h> using namespace std; const int N = 8; int n, m; char a[N][N]; int main(){ scanf("%d%d", &n, &m); for(int i = 0; i < n; i++) scanf("%s", a[i]); for(int x = 0, y = 0; x < n && y < m; ){ a[x][y] = '.'; if(x < n - 1 && a[x + 1][y] == '#') x++; else y++; } for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) if(a[x][y] == '#'){ puts("Impossible"); return 0; } puts("Possible"); }
a.cc: In function 'int main()': a.cc:17:64: error: 'x' was not declared in this scope 17 | for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) if(a[x][y] == '#'){ | ^ a.cc:17:67: error: 'y' was not declared in this scope 17 | for(int i = 0; i < n; i++) for(int j = 0; j < m; j++) if(a[x][y] == '#'){ | ^
s565136978
p03937
C++
#include <bits/stdc++.h> typedef long long LL; using namespace std; #define N 1000010 #define M 1048576 #define inf 1<<30 int n,pre[1000010][26],pp[26][1000010],len[26],ff[N],cnt,key[N]; char s[1000010],t[1000010]; int f[N]; int upp(int r,int aa,int val) { int mid,l=1; while(l<r-1) { mid=(l+r)>>1; if(pp[aa][mid]==val) return pp[aa][mid]; if(pp[aa][mid]<val) l=mid; else r=mid-1; } if(pp[aa][r]<=val)return pp[aa][r]; return pp[aa][l]; } int main() { //freopen("game.in","r",stdin);freopen("game.out","w",stdout); scanf("%d",&n); scanf("%s%s",s+1,t+1); int ii; for(ii=1;ii<=n;ii++) if(s[i]!=t[i]) break; if(ii==n+1) {cout<<0;return 0;} s[0]=t[0]=-1,s[n+1]=t[n+1]=inf; for(int i=1;i<=n;i++) { s[i]-='a',t[i]-='a'; for(int j=0;j<26;j++) pre[i][j]=pre[i-1][j]; pre[i][s[i]]=i,pp[s[i]][++len[s[i]]]=pre[i-1][s[i]]; if(!pre[i][t[i]]) {cout<<-1;return 0;} f[i]=pre[i][t[i]]; } for(int i=0;i<26;i++) pp[i][++len[i]]=pre[n][i],pp[i][++len[i]]=inf; int q=inf; for(int i=n-1;i>=1;i--) { q=min(f[i+1],q); if(len[t[i]]<=10) while(f[i]>q) f[i]=pre[f[i]-1][t[i]]; else f[i]=upp(len[t[i]],t[i],q); if(!f[i]) {cout<<-1;return 0;} } int maxx=0; for(int i=1;i<=n;i++) if(t[i]!=t[i-1]) ff[++cnt]=f[i],key[cnt-1]=i-1; key[cnt]=n,ff[cnt+1]=inf; for(int i=1;i<=cnt;i++) key[i]-=i,ff[i]-=i; for(int i=1;i<=cnt;i++)maxx=max(maxx,(int)(lower_bound(ff+1,ff+cnt+2,key[i])-ff)-i); cout<<maxx; return 0; }
a.cc: In function 'int main()': a.cc:29:35: error: 'i' was not declared in this scope; did you mean 'ii'? 29 | for(ii=1;ii<=n;ii++) if(s[i]!=t[i]) break; | ^ | ii a.cc:6:14: warning: overflow in conversion from 'int' to 'char' changes value from '1073741824' to '0' [-Woverflow] 6 | #define inf 1<<30 | ~^~~~ a.cc:31:36: note: in expansion of macro 'inf' 31 | s[0]=t[0]=-1,s[n+1]=t[n+1]=inf; | ^~~
s773689442
p03937
C++
chad (柳志轩)'s submissions for problem G RunID Status Memory Time Language Length Submit Time 14330670 Submit Failed C++14 (GCC 5.3.0) 1085 2:59:40 #14330670 | chad's solution for [AtCoder-2171] [Problem G] Status Submit Failed Length 1085 Lang C++14 (GCC 5.3.0) Submitted 2018-06-24 11:29:40 Shared Select Code #include<bits/stdc++.h> using namespace std; #define FILE "chad" #define ll long long #define up(i,j,k) for(int i=(j);i<=(k);i++) #define pii pair<int,int> template<class T> bool cmin(T& a,T b){return a>b?a=b,true:false;} template<class T> bool cmax(T& a,T b){return a<b?a=b,true:false;} template<class T> T max(T& a,T& b){return a>b?a:b;} template<class T> T min(T& a,T& b){return a<b?a:b;} const int maxn=255000,inf=1e9,mod=9901; int read(){ int ch=getchar(),x=0,f=1; while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9')x=(x<<3)+(x<<1)+ch-'0',ch=getchar(); return f*x; } ll n,e,t,a[maxn]; ll f[maxn],g[maxn]; int main(){ //freopen(FILE".in","r",stdin); //freopen(FILE".out","w",stdout); n=read(),e=read(),t=read(); up(i,1,n)a[i]=read(); memset(f,10,sizeof(f)); memset(g,10,sizeof(g)); f[1]=a[1];g[1]=a[1]+t; up(i,2,n){ f[i]=g[i-1]+a[i]-a[i-1]; up(j,1,i-1){ if(((a[i]-a[j])<<1)>=t) cmin(g[i],f[j]+3*(a[i]-a[j])); else break; } cmin(g[i],f[i]+t); } //up(i,1,n)cout<<f[i]<<" "<<g[i]<<endl; cout<<g[n]+e-a[n]<<endl; return 0; }
a.cc:1:14: warning: missing terminating ' character 1 | chad (柳志轩)'s submissions for problem G | ^ a.cc:1:14: error: missing terminating ' character 1 | chad (柳志轩)'s submissions for problem G | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:6:12: error: too many decimal points in number 6 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:8:11: error: "|" is not a valid filename 8 | #14330670 | chad's solution for [AtCoder-2171] [Problem G] | ^ a.cc:8:17: warning: missing terminating ' character 8 | #14330670 | chad's solution for [AtCoder-2171] [Problem G] | ^ a.cc:14:20: error: too many decimal points in number 14 | C++14 (GCC 5.3.0) | ^~~~~ a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token 1 | chad (柳志轩)'s submissions for problem G | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:21: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/cstddef:50, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'? 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here 443 | typedef decltype(nullptr) nullptr_t; | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared 2086 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope 2087 | struct remove_extent<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid 2087 | struct remove_extent<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared 2099 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope 2100 | struct remove_all_extents<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid 2100 | struct remove_all_extents<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared 2171 | template<std::size_t _Len> | ^~~ /usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope 2176 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared 2194 | template<std::size_t _Len, std::size_t _Align = | ^~~ /usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^~~~ /usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid 2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)> | ^ /usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope 2202 | unsigned char __data[_Len]; | ^~~~ /usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope 2203 | struct __attribute__((__aligned__((_Align)))) { } __align; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59, from /usr/include/c++/14/bits/stl_algo.h:69, from /usr/include/c++/14/algorithm:61: /usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~~~ /usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'? 131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc) | ^~~~~~ /usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here 214 | typedef __SIZE_TYPE__ size_t; | ^~~~~~ /usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive] 132 | __attribute__((__externally_visible__)); |
s503911612
p03937
C++
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,sum=0; cin>>a>>b; char k[112345]; for(int i=0;i<a;i++){ for(int m=0;m<b;m++){ cin>>k[i][m]; if(k[i][m]=='#') sum++; } } if(sum==a+b-1) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; }
a.cc: In function 'int main()': a.cc:9:16: error: invalid types 'char[int]' for array subscript 9 | cin>>k[i][m]; | ^ a.cc:10:14: error: invalid types 'char[int]' for array subscript 10 | if(k[i][m]=='#') sum++; | ^
s081463485
p03937
C++
#include <iostream> #include <algorithm> #include <cmath> #include <limits> #include <vector> #include <cstdio> #include <bits/stdc++.h> #include <set> #include <stdio.h> using namespace std; using ll =long long; int main (void) { int H,W; cin >> H >>W; int A[H][W]; for (int i=0; i<H; i++) { for (int j=0; j<W; j++) { cin >> A[i][j]; } } for (int i=1; i<W; i++) { if(A[0][i]==35){ for (int j=0; j<H; j++) { if(A[i][j]==35){ cout << "Impossible": return 0; } } if(A[i][0]==35){ for (int j=0; j<H; j++) { if(A[j][i]==35){ cout << "Impossible": return 0; } } } } cout << "Possible"; }
a.cc: In function 'int main()': a.cc:26:33: error: expected ';' before ':' token 26 | cout << "Impossible": | ^ | ; a.cc:33:33: error: expected ';' before ':' token 33 | cout << "Impossible": | ^ | ; a.cc:40:2: error: expected '}' at end of input 40 | } | ^ a.cc:13:17: note: to match this '{' 13 | int main (void) { | ^
s725382290
p03937
C++
豆腐干岁的法国
a.cc:1:1: error: '\U00008c46\U00008150\U00005e72\U00005c81\U00007684\U00006cd5\U000056fd' does not name a type 1 | 豆腐干岁的法国 | ^~~~~~~~~~~~~~
s861049661
p03937
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int w,h,sx,sy,sum; int dir[2][2] = {{1,0},{0,1}}; char Map[25][25]; int flag=0; struct node { int x,y; }; void BFS() { queue<node> q; node n,p; n.x = sx; n.y = sy; q.push(n); while(!q.empty()) { n = q.front(); q.pop(); for(int i = 0; i < 2; i++) { int tx = n.x + dir[i][0]; int ty = n.y + dir[i][1]; if(tx >= 0 && tx < h && ty >= 0 && ty < w && Map[tx][ty] == '#') { if(tx+ty=h-1+w-1) { flag=1; return; } p.x = tx; p.y = ty; q.push(p); } } } return; } int main() { int i,j; cin>>h>>w; for(i = 0; i < h; i++) for(j = 0; j < w; j++) cin >> Map[i][j]; BFS(); if(flag) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc: In function 'void BFS()': a.cc:29:22: error: lvalue required as left operand of assignment 29 | if(tx+ty=h-1+w-1) | ~~^~~
s366146836
p03937
C++
#include <bits/stdc++.h> using namespace std; #define ll long long int w,h,sx,sy,sum; char a[25][25]; int d[25][25]; int main() { memset(d,0,sizeof(d)); int i,j; cin>>h>>w; for(i = 1; i <= h; i++) for(j = 1; j <=w; j++) cin >> a[i][j]; for(i=1; i<h; i++) for(j=1; j<w; j++) { if(a[i][j]=='#'&&a[i+1][j]=='#'&&a[i][j+1]=='#'&&a[i+1][j+1]=='#') { cout<<"Impossible"<<endl; return 0; } } for(i=0; i<=h+1; i++) for(j=0; j<=w+1; j++) { if(i==0||j==0||i==h+1||j==w+1) d[i][j]=1; } i=1,j=1; if(a[h][w]=='.') { cout<<"Impossible"<<endl; } else { for(int k=1;;) { if(i=h&&j=w) break; if(a[i-1][j]=='#'&&!d[i-1][j]) { cout<<"Impossible"<<endl; return 0; } if(a[i][j-1]=='#'&&!d[i][j-1]) { cout<<"Impossible"<<endl; return 0; } if(a[i+1][j]=='#') { d[i][j]=1; i+=1; } else if(a[i][j+1]=='#') { d[i][j]=1; j+=1; } } cout<<"Possible"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:39:19: error: lvalue required as left operand of assignment 39 | if(i=h&&j=w) | ~^~~
s131620712
p03937
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long h,w,cnt=0; char c; cin >> h >> w; for (int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin >> c; if(c=='#'){ cnt++; } } } if(cnt==h+w-1){ cout << "Possible" << endl; }else{ cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s395602244
p03937
C++
#include<cstdio> #include<algorithm> using namespace std; int R, C; char G[15][15]; bool check[15][15]; int main(){ scanf("%d %d", &R, &C); memset(check, true, sizeof(check)); for(int i=0;i<R;i++){ scanf("%s", G[i]); for(int j=0;j<C;j++){ if (G[i][j] == '#'){ check[i][j] = false; } } } bool changed = true; int posX = 0, posY = 0; while(changed){ changed = false; while(posX != R-1 && G[posX+1][posY] == '#'){ posX++; check[posX][posY] = true; changed = true; } while(posY != C-1 && G[posX][posY+1] == '#'){ posY++; check[posX][posY] = true; changed = true; } } bool ans = true; for(int i=0;i<R;i++){ for(int j=0;j<C;j++){ ans &= check[i][j]; } } printf("%s\n", ans?"Possible":"Impossible"); return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(check, true, sizeof(check)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> 3 |
s524701627
p03937
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;++i) #define yesno(flg) if(flg){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;} #define MAX_N 10 using namespace std; typedef long long ll; typedef pair<int,int> P1; typedef pair<P1,P1> P2; const ll INF=100000000000000001; int dp[MAX_N][MAX_N]={}; bool d[MAX_N]={}; struct edge{int to,cost;}; int dy[]={0, 0, 1, -1}; int dx[]={1, -1, 0, 0}; queue<P1> que; vector<string> v; int main() { int h,w; cin>>h>>w; rep(i,h){ rep(j,w){ char chr; cin>>chr; if(chr=='#')dp[i][j]=1; } } que.push(P1(0,0)); while(!que.empty()){ P1 pp1=que.front();que.pop(); int x=pp1.first; int y= pp1.second; dp[x][y]=2; if(dp[x+1][y]==1&&dp[x][y+1]==1){ cout<<"Impossible"<<endl; return 0; } if(dp[x+1][y]==1)que.push(P1(x+1,y)); if(dp[x][y+1]==1)que.push(P1(x,y+1)); } bool flg=true; rep(i,h){ rep(j,w){ if(dp[i][j]==1)flg=false; } } if(flg){ cout<<"Possible"<<endl; }else{ cout<<"Impossible"<<endl; } cout<<dp[k]<<endl; return 0; }
a.cc: In function 'int main()': a.cc:52:18: error: 'k' was not declared in this scope 52 | cout<<dp[k]<<endl; | ^
s896889380
p03937
C++
#include <bits/stdc++.h> using namespace std; char a[11][11]; int main () { int n, m; cin >> n >> m; for (int i = 1;i <= n;i ++) { for (int j = 1;j <= m;j ++) { cin >> a[i][j]; if (a[i][j] != '#' || (i == 1 && j == 1)) continue; if (a[i - 1][j] == '#' && a[i][j - 1] == '#') { cout << "Impossible"; return 0; } if (a[i - 1][j] != '#' && a[i][j - 1] != '#') { cout << "Impossible"; return 0; } } } if (a[n][m] != '#') cout << "Impossible" else cout << "Possible"; return 0; }
a.cc: In function 'int main()': a.cc:24:49: error: expected ';' before 'else' 24 | if (a[n][m] != '#') cout << "Impossible" | ^ | ; 25 | else cout << "Possible"; | ~~~~
s077152569
p03937
C++
#include <iostream> #include <cstring> #include <string> #include <algorithm> #include <cstdlib> #include <cstdio> #include <map> #include <set> #include <cmath> #include <vector> #include <ctime> #include <Queue> #include <sstream> #include <utility> #include <bitset> #include <stack> using namespace std; #define MP make_pair #define PB push_back #define INF (1000000007) #define eps 1e-8 #define MOD (1000003) #define IOS ios::sync_with_stdio(false) typedef pair<int,int> pii ; typedef pair<double,double> pdd ; typedef long long ll ; ll n,e,t; ll dp[100005],p[100005]; ll mx=1e18; multiset<ll>s; int main() { IOS; cin>>n>>e>>t; for(int i=1;i<=n;i++) cin>>p[i]; dp[0]=0; int pos=0; for(int i=1;i<=n;i++) { s.insert(dp[i-1]); while(pos<=i) { if((p[i]-p[pos])*2>t) { mx=min(dp[pos-1]-p[pos]*2,mx); s.erase(dp[pos-1]); pos++; } else break; } dp[i]=min(*s.begin()+ta,mx+2*p[i]); } cout<<dp[n]+e; return 0; }
a.cc:12:10: fatal error: Queue: No such file or directory 12 | #include <Queue> | ^~~~~~~ compilation terminated.
s165264697
p03937
C++
#include<iostream> #include<cstdio> #include<vector> #include<algorithm> using namespace std; typedef long long ll; const int N=140010; int val[N]; int son[N][2]; ll dis[N]; void calcdis(int u,ll Dis) { dis[u]=Dis; int s1=son[u][0],s2=son[u][1]; if(!s1) return; calcdis(s1,Dis+ll(val[s1]));calcdis(s2,Dis+ll(val[s2])); } struct data { int s,t; data(){} data(int s,int t):s(s),t(t){} }; vector<data>q[N]; int work(int u,int mx,int s1,int s2,data que[]) { int sz1=(int)q[s1].size(),sz2=(int)q[s2].size(); int l=0,cnt=0; for(int i=0;i<sz1;i++) { bool flag=false; while(l<sz2&&dis[q[s1][i].t]+dis[q[s2][l].s]-(dis[u]<<1)<=ll(mx)) { l++; flag=true; } if(!flag) continue; que[cnt++]=data(q[s1][i].s,q[s2][l-1].t); } return cnt; } data que1[N],que2[N]; bool solve(int u,int mx) { q[u].clear(); int s1=son[u][0],s2=son[u][1]; if(!s1) { q[u].push_back(data(u,u)); return true; } if(!solve(s1,mx)||!solve(s2,mx)) return false; int cnt1=work(u,mx,s1,s2,que1),cnt2=work(u,mx,s2,s1,que2); if(!cnt1&&!cnt2) return false; int p1=0,p2=0; while(p1<cnt1||p2<cnt2) { if(p1==cnt1) q[u].push_back(que2[p2++]); else if(p2==cnt2) q[u].push_back(que1[p1++]); else{ if(dis[que1[p1].s]<dis[que2[p2].s]) { q[u].push_back(que1[p1]); while(p2<cnt2&&dis[que2[p2].t]>=dis[que1[p1].t]) p2++; p1++; } else{ q[u].push_back(que2[p2]); while(p1<cnt1&&dis[que1[p1].t]>=dis[que2[p2].t]) p1++; p2++; } } } return true; } int main() { int Size = 64 << 20; // 64MB char *p = (char*)malloc(Size) + Size; __asm__("movl %0, %%esp\n" :: "r"(p)); int n;scanf("%d",&n); for(int i=2;i<=n;i++) { int Fa;scanf("%d%d",&Fa,&val[i]); if(!son[Fa][0]) son[Fa][0]=i; else son[Fa][1]=i; } calcdis(1,0ll); int l=0,r=1,now=2; while(now*2<n) { now*=2; r++; } r*=2000000; int ans; while(l<=r) { int mid=(l+r)>>1; if(solve(1,mid)==true) { ans=mid; r=mid-1; } else l=mid+1; } printf("%d\n",ans); return 0; }
a.cc:24:12: error: template argument 1 is invalid 24 | vector<data>q[N]; | ^ a.cc:24:12: error: template argument 2 is invalid a.cc:25:37: error: reference to 'data' is ambiguous 25 | int work(int u,int mx,int s1,int s2,data que[]) | ^~~~ In file included from /usr/include/c++/14/string:53, 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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:18:8: note: 'struct data' 18 | struct data | ^~~~ a.cc:25:37: error: 'data' has not been declared 25 | int work(int u,int mx,int s1,int s2,data que[]) | ^~~~ a.cc: In function 'int work(int, int, int, int, int*)': a.cc:27:28: error: request for member 'size' in 'q[s1]', which is of non-class type 'int' 27 | int sz1=(int)q[s1].size(),sz2=(int)q[s2].size(); | ^~~~ a.cc:32:25: error: 'sz2' was not declared in this scope; did you mean 'sz1'? 32 | while(l<sz2&&dis[q[s1][i].t]+dis[q[s2][l].s]-(dis[u]<<1)<=ll(mx)) | ^~~ | sz1 a.cc:32:39: error: invalid types 'int[int]' for array subscript 32 | while(l<sz2&&dis[q[s1][i].t]+dis[q[s2][l].s]-(dis[u]<<1)<=ll(mx)) | ^ a.cc:32:55: error: invalid types 'int[int]' for array subscript 32 | while(l<sz2&&dis[q[s1][i].t]+dis[q[s2][l].s]-(dis[u]<<1)<=ll(mx)) | ^ a.cc:38:28: error: reference to 'data' is ambiguous 38 | que[cnt++]=data(q[s1][i].s,q[s2][l-1].t); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:18:8: note: 'struct data' 18 | struct data | ^~~~ a.cc:38:38: error: invalid types 'int[int]' for array subscript 38 | que[cnt++]=data(q[s1][i].s,q[s2][l-1].t); | ^ a.cc:38:49: error: invalid types 'int[int]' for array subscript 38 | que[cnt++]=data(q[s1][i].s,q[s2][l-1].t); | ^ a.cc: At global scope: a.cc:42:1: error: reference to 'data' is ambiguous 42 | data que1[N],que2[N]; | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:18:8: note: 'struct data' 18 | struct data | ^~~~ a.cc: In function 'bool solve(int, int)': a.cc:45:14: error: request for member 'clear' in 'q[u]', which is of non-class type 'int' 45 | q[u].clear(); | ^~~~~ a.cc:49:22: error: request for member 'push_back' in 'q[u]', which is of non-class type 'int' 49 | q[u].push_back(data(u,u)); | ^~~~~~~~~ a.cc:49:32: error: reference to 'data' is ambiguous 49 | q[u].push_back(data(u,u)); | ^~~~ /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)' 344 | data(initializer_list<_Tp> __il) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])' 334 | data(_Tp (&__array)[_Nm]) noexcept | ^~~~ /usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)' 323 | data(const _Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ /usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)' 312 | data(_Container& __cont) noexcept(noexcept(__cont.data())) | ^~~~ a.cc:18:8: note: 'struct data' 18 | struct data | ^~~~ a.cc:53:34: error: 'que1' was not declared in this scope 53 | int cnt1=work(u,mx,s1,s2,que1),cnt2=work(u,mx,s2,s1,que2); | ^~~~ a.cc:54:20: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'? 54 | if(!cnt1&&!cnt2) return false; | ^~~~ | cnt1 a.cc:56:27: error: 'cnt2' was not declared in this scope; did you mean 'cnt1'? 56 | while(p1<cnt1||p2<cnt2) | ^~~~ | cnt1 a.cc:58:35: error: request for member 'push_back' in 'q[u]', which is of non-class type 'int' 58 | if(p1==cnt1) q[u].push_back(que2[p2++]); | ^~~~~~~~~ a.cc:58:45: error: 'que2' was not declared in this scope 58 | if(p1==cnt1) q[u].push_back(que2[p2++]); | ^~~~ a.cc:59:40: error: request for member 'push_back' in 'q[u]', which is of non-class type 'int' 59 | else if(p2==cnt2) q[u].push_back(que1[p1++]); | ^~~~~~~~~ a.cc:61:48: error: 'que2' was not declared in this scope 61 | if(dis[que1[p1].s]<dis[que2[p2].s]) | ^~~~ a.cc:63:38: error: request for member 'push_back' in 'q[u]', which is of non-class type 'int' 63 | q[u].push_back(que1[p1]); | ^~~~~~~~~ a.cc:68:38: error: request for member 'push_back' in 'q[u]', which is of non-class type 'int' 68 | q[u].push_back(que2[p2]); | ^~~~~~~~~
s736378208
p03937
C++
#include<bits/stdc++.h> using namespace std; int h, w, cnt; string s[8]; int main() { cin >> h >> w; for(int i = 0; i < h; i++) cin >> s[i]; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (s[i][j] == '#') cnt++; } } if (cnt == (h + w - 1)) cout << "Possible" << endl; else cout << "Impossible” << endl; return 0; }
a.cc:18:18: warning: missing terminating " character 18 | else cout << "Impossible” << endl; | ^ a.cc:18:18: error: missing terminating " character 18 | else cout << "Impossible” << endl; | ^~~~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:20:5: error: expected primary-expression before 'return' 20 | return 0; | ^~~~~~
s010804782
p03937
C++
#include<bits/stdc++.h> using namespace std; int h, w, cnt; string s[8]; int main() { cin >> h >> w; for(int i = 0; i < h; i++) cin >> s[i]; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (s[i][j] == '#') cnt++; } } if (cnt == (h + w - 1)) cout << ”Possible” << endl; else cout << ”Impossible” << endl; return 0; }
a.cc:17:37: error: extended character ” is not valid in an identifier 17 | if (cnt == (h + w - 1)) cout << ”Possible” << endl; | ^ a.cc:17:37: error: extended character ” is not valid in an identifier a.cc:18:18: error: extended character ” is not valid in an identifier 18 | else cout << ”Impossible” << endl; | ^ a.cc:18:18: error: extended character ” is not valid in an identifier a.cc: In function 'int main()': a.cc:17:37: error: '\U0000201dPossible\U0000201d' was not declared in this scope 17 | if (cnt == (h + w - 1)) cout << ”Possible” << endl; | ^~~~~~~~~~ a.cc:18:18: error: '\U0000201dImpossible\U0000201d' was not declared in this scope 18 | else cout << ”Impossible” << endl; | ^~~~~~~~~~~~
s991819372
p03937
C++
#include <stdio.h> int main(){ int h, w, i, ct=0; char c; scanf("%d%d\n",&h,&w); for( i=0; i<h; i++ ){ for( j=0; j<w; j++ ){ scanf("%c",c); if( c=='#' ) ct++; } gatchar(); } if( ct == w+h+1 ) printf("Possible\n"); else printf("Impossible\n"); return 0; }
a.cc: In function 'int main()': a.cc:8:22: error: 'j' was not declared in this scope 8 | for( j=0; j<w; j++ ){ | ^ a.cc:12:17: error: 'gatchar' was not declared in this scope; did you mean 'getchar'? 12 | gatchar(); | ^~~~~~~ | getchar
s378725551
p03937
C++
h, w = map(int, input().split()) a = [input() for i in range(h)] dx = [1, 0, -1, 0] dy = [0, -1, 0, 1] def check(y, x): for i in range(4): cnt = 0 ny = y + dy[i] nx = x + dx[i] if (ny < 0) or (ny >= h) or (nx < 0) or (nx >= w): continue if a[ny][nx] == '#': cnt+=1 if cnt >= 3: return 1; else: return 0; def dfs(y, x): if a[y][x] == '#': return 0 if (y == h - 1) and (x == w - 1): return 1 dfs(y + 1, x) dfs(y, x + 1) return 0 ans = "Possible" for i in range(h): for j in range(w): if a[i][j] == '#': if check(i,j): ans = "Inpossible" if not dfs(0, 0): ans = "Inpossible" print (ans)
a.cc:1:1: error: 'h' does not name a type 1 | h, w = map(int, input().split()) | ^ a.cc:18:5: error: expected unqualified-id before 'else' 18 | else: | ^~~~ a.cc:21:1: error: 'def' does not name a type 21 | def dfs(y, x): | ^~~
s956639911
p03937
C++
#include <iostream> #include <vector> #include <set> #include <queue> #include <algorithm> #include <string> #include <cmath> using namespace std; #define MAX 100 int is[MAX]; int h, w; string s[8]; bool judge() { int start = 0; for (int row = 0; row < h; ++row) { start = searchRowEnd(start, row); if (start == -1) { return false; } } return start == w - 1; } int searchRowEnd(int start, int row) { int endCol = -1; bool onLoad = false; for (int col = 0; col < w; col++) { if (col >= start && endCol == -1) { onLoad = true; } if (onLoad && s[row][col] != '#') { endCol = col - 1; } if (!onLoad && s[row][col] == '#') { return -1; } } return endCol; } int main(void) { cin >> h >> w; for (int i = 0; i < h; ++i) { cin >> s[i]; } bool f = judge(); cout << (f ? "Possible" : "Impossible") << endl; return 0; }
a.cc: In function 'bool judge()': a.cc:16:21: error: 'searchRowEnd' was not declared in this scope 16 | start = searchRowEnd(start, row); | ^~~~~~~~~~~~
s168407402
p03937
C++
int main() { vector<string> s(8); int h, w, cnt=0; cin >> h >> w; rep(i, h) cin >> s[i]; rep(i, h) rep(j, w) if (s[i][j] == '#') cnt++; h+w - 1 == cnt ? cout << "Possible" << endl : cout << "Impossible" << endl; }
a.cc: In function 'int main()': a.cc:2:9: error: 'vector' was not declared in this scope 2 | vector<string> s(8); | ^~~~~~ a.cc:2:16: error: 'string' was not declared in this scope 2 | vector<string> s(8); | ^~~~~~ a.cc:2:24: error: 's' was not declared in this scope 2 | vector<string> s(8); | ^ a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> h >> w; | ^~~ a.cc:5:13: error: 'i' was not declared in this scope 5 | rep(i, h) | ^ a.cc:5:9: error: 'rep' was not declared in this scope 5 | rep(i, h) | ^~~ a.cc:11:26: error: 'cout' was not declared in this scope 11 | h+w - 1 == cnt ? cout << "Possible" << endl : cout << "Impossible" << endl; | ^~~~ a.cc:11:48: error: 'endl' was not declared in this scope 11 | h+w - 1 == cnt ? cout << "Possible" << endl : cout << "Impossible" << endl; | ^~~~
s780276101
p03937
C++
#include <bits/stdc++.h> using namespace std; int main () { int H,W; cin >> H >> W; int cnt=0; for (int i=0; i<H; ++i) { string s; cin >> s; for(auto c : s) { if( c == '#' ) w++; } } if( cnt == H+W-1 ) cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:14:28: error: 'w' was not declared in this scope 14 | if( c == '#' ) w++; | ^
s549898379
p03937
C++
#include<cstdio> using namespace std; int d[10][10]; char ma[10][10]; int main(){ //freopen("a.in","r", stdin); //freopen("a.out", "w", stdout); int n, m, i, j; scanf("%d%d", &n, &m); gets(ma[0]); for(i=1; i<=n; i++) gets(ma[i]); for(i=n; i>=1; i--) for(j=1; j<=m; j++){ d[i][j]=d[i+1][j] + d[i][j-1] - d[i+1][j-1] + (ma[i][j-1]=='#'); } for(i=1; i<=n; i++){ for(j=1; j<=m; j++) printf("%d ", d[i][j]); printf("\n"); } i=1; j=1; bool b=1; while(b && (i!=n && j!=m)){ if(d[i+1][j-1]) b=0; if(ma[i][j+1]=='#' && j<=m) j++; else if(ma[i+1][j]=='#' && i<=n) i++; else b=0; } if(!b) printf("Impossible"); else printf("Possible"); return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | gets(ma[0]); | ^~~~ | getw
s121175414
p03937
C++
test-code
a.cc:1:1: error: 'test' does not name a type 1 | test-code | ^~~~
s073028032
p03937
C++
test-code
a.cc:1:1: error: 'test' does not name a type 1 | test-code | ^~~~
s213280260
p03937
C++
#include <iostream> #include <string> using namespace std; const int NMAX = 8 + 5; int n, m; string mat[NMAX]; bool works(int lin, int col) { if (mat[lin][col] != '#') return false; if (lin == n && col == m) return true; if (mat[lin + 1][col] == '#') return works(lin + 1, col); if (mat[lin][col + 1] == '#') return works(lin + 1, col); } int main() { cin >> n >> m; for (int i = 1; i <= n; ++ i) { cin >> mat[i]; mat[i] = " " + mat[i]; } int cnt = 0; for (int i = 1; i <= n; ++ i) for (auto it: str[i]) cnt += (it == '#'); if (cnt != n + m - 1) { cout << "Impossible\n"; return 0; } if (works(1, 1)) cout << "Possible\n"; else cout << "Impossible\n"; return 0; }
a.cc: In function 'int main()': a.cc:34:23: error: 'str' was not declared in this scope; did you mean 'std'? 34 | for (auto it: str[i]) | ^~~ | std a.cc: In function 'bool works(int, int)': a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type] 21 | } | ^
s420545623
p03937
C++
#include <iostream> int main(){ int H,W,c=0; char a; std::cin>>H>>W; while(cin>>a)c+=a=='#'; std::cout<<(c==H+W-1?"P":"Imp")<<"ossible\n"; }
a.cc: In function 'int main()': a.cc:6:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 6 | while(cin>>a)c+=a=='#'; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~
s950980929
p03937
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <algorithm> #include <vector> #include <list> #include <bitset> #include <iostream> #include <set> #include <map> #include <string> #include <sstream> #include <climits> #include <cmath> #include <stack> #include <queue> #include <cfloat> #include <initializer_list> #include <iomanip> #include <functional> #include <unordered_map> #include <regex> using namespace std; int main(int argc, char *argv[]) { int H, W; cin >> H >> W; int sum = 0; for (int i = 0; i < H; ++i) { for (int j = 0; j < W; ++j) { char c; cin >> c; if (grid[i][j] == '#') ++sum; } } if (sum == H + W - 1) cout << "Possible" << endl; else cout << "Impossible" << endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:37:15: error: 'grid' was not declared in this scope 37 | if (grid[i][j] == '#') ++sum; | ^~~~
s956908534
p03937
C++
#include <bits/stdc++.h> using namespace std; #define INF 1000000009 #define INP "input.txt" #define OUT "output.txt" int n, m; char arr[10][10]; bool solution() { int cnt = 0; for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) { if(arr[i][j] == '#') cnt++; } if(cnt != n + m - 1) return false; int i, j; i = j = 0; if(arr[i][j] != '#') return false; while(i != n - 1 && j != m - 1) { if(i + 1 < n && arr[i + 1][j] == '#') i++; else if(j + 1 < m && arr[i][j + 1] == '#') j++; else return false; } return true; } int main () { //freopen(INP, "r", stdin); //freopen(OUT, "w", stdout); scanf(" %d %d ", &n, &m); for(int i = 0; i < n; i++) { gets(arr[i]); } if(solution) printf("Possible\n"); else printf("Impossible\n"); return 0; }
a.cc: In function 'int main()': a.cc:38:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 38 | gets(arr[i]); | ^~~~ | getw
s687016544
p03937
C++
#include<stdio.h> #include<string.h> #include<algorithm> #include<vector> using namespace std; int x[1000005]; long long int dp[1000005]; long long int dp2[1000005]; int main(){ int n,e,t; scanf("%d %d %d",&n,&e,&t); for(int i=0;i<n;i++) dp[i]=1e18; dp[0]=t; scanf("%d",&x[0]); for(int i=1;i<n;i++) scanf("%d",&x[i]),x[i]-=x[0]; x[0]=0; int p=0,mini=1e9; dp[0]=t; dp2[0]=dp[i]-x[i+1]*2;; for(int i=1;i<n;i++){ dp[i]=max(t,x[i]*2); int Min=0,Max=i-1; while(Max-1>Min){ int mid=(Max+Min)/2; if((x[i]-x[mid+1])*2<t){ Min=mid; } else{ Max=mid; } } if((x[i]-x[p+1])*2>t) p++; dp[i]=min(x[i]*2+dp2[p-1],t+dp[p]); dp2[i]=min(dp2[i-1],dp[i]-x[i+1]*2); // printf("%d\n",dp[i]); } printf("%lld",dp[n-1]+e); }
a.cc: In function 'int main()': a.cc:21:19: error: 'i' was not declared in this scope 21 | dp2[0]=dp[i]-x[i+1]*2;; | ^
s489790105
p03937
C++
#include<bits/stdc++.h> using namespace std; char masu[12][12]; int n,m,ans,x,y; bool flag=false,s1=false,s2=false;; queue <pair <int,int> > pp; int main(){ cin >> n >> m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin >> masu[j][i]; } } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if( masu[j][i]=='#'&&masu[j+1][i-1]||masu[j-1][i+1])break; } if(i==m&&j==n)flag=true; } if(flag==true)cout << "Possible" << endl; else cout << "Impossible" << endl; //cin >> x; return 0; }
a.cc: In function 'int main()': a.cc:20:18: error: 'j' was not declared in this scope 20 | if(i==m&&j==n)flag=true; | ^
s520842174
p03937
C++
#include<iostream> using namespace std; char data1[10][10]; int main() { int h, w; cin >> h >> w; for (int i = 1; i <= h; ++i) for (int j = 1; j <= w; ++j) cin >> data1[i][j]; for (int i = 1; i <h; ++i) for (int j = 1; j < w; ++j) { if (data1[i][j] == '#'&&data1[i][j + 1] == '#'&&data1[i + 1][j] == '#') { cout << "Impossible" << endl; return 0; } else if((data1[i][j] == '#'&&data1[i-1][j] == '#'&&data1[i][j-1] == '#'&&i!=1) { cout << "Impossible" << endl; return 0; } } cout << "Possible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:103: error: expected ')' before '{' token 19 | else if((data1[i][j] == '#'&&data1[i-1][j] == '#'&&data1[i][j-1] == '#'&&i!=1) | ~ ^ | ) 20 | { | ~ a.cc:26:17: error: expected primary-expression before '}' token 26 | } | ^
s132164440
p03937
C++
#include<iostream> using namespace std; char data1[10][10]; int main() { int h, w; cin >> h >> w; for (int i = 1; i <= h; ++i) for (int j = 1; j <= w; ++j) cin >> data1[i][j]; for (int i = 1; i <h; ++i) for (int j = 1; j < w; ++j) { if (data1[i][j] == '#'&&data1[i][j + 1] == '#'&&data1[i + 1][j] == '#') { cout << "Impossible" << endl; return 0; } else if((data1[i][j] == '#'&&data1[i-1][j] == '#'&&data1[i][j-1] == '#'&&i!=1) } cout << "Possible" << endl; return 0; }
a.cc: In function 'int main()': a.cc:19:103: error: expected ')' before '}' token 19 | else if((data1[i][j] == '#'&&data1[i-1][j] == '#'&&data1[i][j-1] == '#'&&i!=1) | ~ ^ | ) 20 | 21 | } | ~ a.cc:21:17: error: expected primary-expression before '}' token 21 | } | ^
s779529958
p03937
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a); i<(b); i++) #define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--) #define REP(i,n) for(int i=0; i<(n); i++) #define RREP(i,n) for (int i=(n)-1;i>=0;i--) #define LL long long #define ULL unsigned long long using namespace std; char nmap[10][10]; int h,w; bool solve(int y, int x) { if(y == h-1 && x == w-1) { nmap[y][x] = 'A'; REP(i,h) { if(0 < count(nmap[i], nmap[i] +w-1, '#')) { REP(j,h) replace(nmap[j], nmap[j] +w-1, 'A', '#'); return false; } } return true; } bool a=false,b=false; if(x+1 < w && nmap[y][x+1] == '#') { nmap[y][x] = 'A'; a = solve(y,x+1); } if(y+1 < h && nmap[y+1][x] == '#') { nmap[y][x] = 'A'; b = solve(y+1,x); } return a||b; } int main() { REP(i,10) nmap[i] = ".........."; cin>>h>>w; REP(i,h) cin>>nmap[i]; cout << (solve(0,0)?"Possible":"Impossible") << endl; return 0; }
a.cc: In function 'int main()': a.cc:38:27: error: incompatible types in assignment of 'const char [11]' to 'char [10]' 38 | REP(i,10) nmap[i] = ".........."; | ~~~~~~~~^~~~~~~~~~~~~~
s421225956
p03937
C++
#include<iostream> #include<cstdio> #include<cstring> #include<string> using namespace std; char a[10][10]; int g=0,ans=0,l,r; int next[2][2]={{0,1},{1,0}}; void dfs(int x,int y) { if(x==r-1&&y==l-1) { ans=1;return ;} for(int i=0;i<=1;i++) { int dx=x+next[i][0]; int dy=y+next[i][1]; if(a[dx][dy]=='#'&&dx>=0&&dx<r&&dy>=0&&dy<=l) dfs(dx,dy); } } int main() { scanf("%d%d",&r,&l); for(int i=0;i<r;i++) { getchar(); for(int j=0;j<l;j++) { scanf("%c",&a[i][j]); if(a[i][j]=='#') g++; } } dfs(0,0); if(ans==1&&g==r+l-1) printf("Possible\n"); else printf("Impossible\n"); return 0; }
a.cc: In function 'void dfs(int, int)': a.cc:14:18: error: reference to 'next' is ambiguous 14 | int dx=x+next[i][0]; | ^~~~ In file included from /usr/include/c++/14/string:47, 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_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:8:5: note: 'int next [2][2]' 8 | int next[2][2]={{0,1},{1,0}}; | ^~~~ a.cc:15:18: error: reference to 'next' is ambiguous 15 | int dy=y+next[i][1]; | ^~~~ /usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)' 232 | next(_InputIterator __x, typename | ^~~~ a.cc:8:5: note: 'int next [2][2]' 8 | int next[2][2]={{0,1},{1,0}}; | ^~~~
s890396998
p03937
C
#include <stdio.h> int main(void) { int height,width; int flag = 0; scanf("%d %d",&height,&width); int nowPositionH = 0; int nowPositionW = 0; char mozi[height + 5][width + 5]; for(int i = 0 ; i < height ; i ++){ scanf("%s", mozi[i]); } int hcount = 0; int wcount = 0; int fw = 0; while(1){ if(mozi[nowPositionH][nowPositionW + 1] == '#'){ if(nowPositionH == height -1 && nowPositionW > fw){ if(mozi[nowPositionH - 1][nowPositionW] == '#'){ flag = 1; break; } } if(mozi[nowPositionH + 1][nowPositionW] == '#'){ flag = 1; break; } nowPositionW++; } else if(mozi[nowPositionH + 1][nowPositionW] == '#'){ nowPositionH++; if(nowPositon == height){ fw = nowPositionW; } } else { flag = 1; break; } hcount++; if(nowPositionH == height -1 && nowPositionW == width -1){ break; } } nowPositionH = 0; nowPositionW = 0; if(flag == 0){ while(1){ if(mozi[nowPositionH + 1][nowPositionW] == '#'){ if(mozi[nowPositionH][nowPositionW + 1] == '#'){ flag = 1; break; } nowPositionH++; } else if(mozi[nowPositionH][nowPositionW + 1] == '#'){ nowPositionW++; } else { flag = 1; break; } wcount++; if(nowPositionH == height - 1 && nowPositionW == width - 1){ break; } } } if(mozi[height -2][width - 1] == '#' && mozi[height -1][width - 2] == '#'){ flag = 1; } if(hcount != wcount){ flag = 1; } if(flag == 0){ printf("Possible\n"); } else { printf("Impossible\n"); } return 0; }
main.c: In function 'main': main.c:35:28: error: 'nowPositon' undeclared (first use in this function); did you mean 'nowPositionW'? 35 | if(nowPositon == height){ | ^~~~~~~~~~ | nowPositionW main.c:35:28: note: each undeclared identifier is reported only once for each function it appears in
s533310281
p03937
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); try { int height = sc.nextInt(); int width = sc.nextInt(); char[][] list = new char[height][width]; for (int i = 0; i < height; i++) { String str = sc.next(); for (int j = 0; j < width; j++) { list[i][j] = str.charAt(j); } } int count = 0; boolean result = false; for (int i = 0; i < height; i++) { boolean flg = false; for (int j = 0; j < width; j++) { if (list[i][j] == '#') { if (flg) { count++; } flg = true; } else { flg = false; } } } if (count == width - 1) { result = true; } else { System.out.println("Impossible"); } if (result) { count = 0; for (int i = 0; i < width; i++) { boolean flg = false; for (int j = 0; j < height; j++) { if (list[j][i] == '#') { if (flg) { count++; } flg = true; } else { flg = false; } } } if (count == height - 1) { System.out.println("Possible"); } } } finally { sc.close(); } } }
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s683043027
p03937
C++
bool calc1(char** arr, int height, int width, int i, int j) { if(i < 0 || height <= i || j < 0 || width <= j) return false; if(i == height - 1 && j == width - 1) { if(arr[i][j] =='#') return true; else return false; } if(arr[i][j] == '.') return false; if(calc1(arr, height, width, i + 1, j)) return true; if(calc1(arr, height, width, i, j + 1)) return true; return false; } int sumup(char* arr, int len) { int n = 0; for(int i = 0; i < len; i++) if(arr[i] == '#') n++; return n; } int main(void) { int h, w; std::cin >> h; std::cin >> w; char** arr = new char*[h]; for(int i = 0; i < h; i++) { arr[i] = new char[w]; } int n = 0; for(int i = 0; i < h; i++) { std::cin >> arr[i]; n += sumup(arr[i], w); } if(n == (h + w - 1) && calc1(arr, h, w, 0, 0)) std::cout << "Possible\n"; else std::cout << "Impossible\n"; return 0; }
a.cc: In function 'int main()': a.cc:25:8: error: 'cin' is not a member of 'std' 25 | std::cin >> h; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | bool calc1(char** arr, int height, int width, int i, int j) { a.cc:26:8: error: 'cin' is not a member of 'std' 26 | std::cin >> w; | ^~~ a.cc:26:8: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:33:10: error: 'cin' is not a member of 'std' 33 | std::cin >> arr[i]; | ^~~ a.cc:33:10: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:37:10: error: 'cout' is not a member of 'std' 37 | std::cout << "Possible\n"; | ^~~~ a.cc:37:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:39:10: error: 'cout' is not a member of 'std' 39 | std::cout << "Impossible\n"; | ^~~~ a.cc:39:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s844165745
p03937
C++
include<iostream> using namespace std; int main() { int h,w; char a[10][10]; cin>>h>>w; int sum=0; for(int i=0;i<h;i++) { for(int j=0;j<w;j++) { cin>>a[i][j]; if(a[i][j]=='#') sum++; } } if(sum==2*h) cout<<"Possible"<<endl; else cout<<"Impossible"<<endl; return 0; }
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:8:5: error: 'cin' was not declared in this scope 8 | cin>>h>>w; | ^~~ a.cc:20:9: error: 'cout' was not declared in this scope 20 | cout<<"Possible"<<endl; | ^~~~ a.cc:20:27: error: 'endl' was not declared in this scope 20 | cout<<"Possible"<<endl; | ^~~~ a.cc:21:10: error: 'cout' was not declared in this scope 21 | else cout<<"Impossible"<<endl; | ^~~~ a.cc:21:30: error: 'endl' was not declared in this scope 21 | else cout<<"Impossible"<<endl; | ^~~~
s916938829
p03937
C++
#include <cstdio> #include <iostream> using namespace std; #define maxn 10 char s[maxn][maxn]; int h, w; bool fuck(char s[][maxn], int i, int j) { if (i == h - 1 && j == w - 1 && s[i][j] == '#') return 1; else if (i < h - 1 && s[i + 1][j] == '#' && j == w - 1) fuck(s, i + 1, j); else if (i == h - 1 && j < w - 1 && s[i][j + 1] == '#') fuck(s, i, j + 1); else if (i < h - 1 && s[i + 1][j] == '#' && j < w - 1 && s[i][j + 1] != '#') fuck(s, i + 1, j); else if (i < h - 1 && s[i + 1][j] != '#' && j < w - 1 && s[i][j + 1] == '#') fuck(s, i, j + 1); else if (i < h - 1 && s[i + 1][j] == '#' && j < w - 1 && s[i][j + 1] == '#') return 0; else return 0; } int main() { cin >> h >> w; memset(s, NULL, sizeof(s)); char a; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) scanf("%c", &s[i][j]); scanf("%c", &a); } if (fuck(s, 0, 0)) { printf("Possible\n"); } else { printf("Impossible\n"); } return 0; }
a.cc: In function 'int main()': a.cc:28:9: error: 'memset' was not declared in this scope 28 | memset(s, NULL, sizeof(s)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <iostream> +++ |+#include <cstring> 3 | using namespace std; a.cc: In function 'bool fuck(char (*)[10], int, int)': a.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type] 24 | } | ^
s235892405
p03937
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) REP(i,0,n) #define REP(i,a,n) for(int i = a ; i < (int)n ; i++) int H, W; string map[10]; int dx[] = {1, 0}; //, -1, 0}; int dy[] = {0, 1}; //, 0, 1}; void dump(){ rep(i,H){ rep(j, W){ cout << map[i][j]; } puts(""); } puts(""); } void solve(int x, int y){ map[y][x] = '.'; if(x == W-1 && y == H-1){ rep(i,H){ rep(j, W){ if(map[i][j]=='#'){ cout << "Impossible" << endl; exit(0); } } } cout << "Possible" << endl; exit(0); } //dump(); //cout << "x: " << x << " y: " << y << endl; rep(i, 2){ int nx = x + dx[i]; int ny = y + dy[i]; if(0 <= nx && nx < W && 0 <= ny && ny < H && map[ny][nx]=='#') { // && x <= nx && y <= ny){ //cout << "nx :" << nx << " ny : " << ny << endl; solve(nx, ny); //cout << "x: " << x << " y: " << y << endl; } } } int main(){ cin >> H >> W; rep(i, H){ cin >> map[i]; } solve(0,0); rep(i,H){ rep(j, W){ if(map[i][j]=='#'){ cout << "Impossible" << endl; exit(0); } } } cout << "Possible" << endl; }
a.cc: In function 'void dump()': a.cc:16:15: error: reference to 'map' is ambiguous 16 | cout << map[i][j]; | ^~~ In file included from /usr/include/c++/14/map:63, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152, from a.cc:1: /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~ a.cc: In function 'void solve(int, int)': a.cc:25:3: error: reference to 'map' is ambiguous 25 | map[y][x] = '.'; | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~ a.cc:30:10: error: reference to 'map' is ambiguous 30 | if(map[i][j]=='#'){ | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~ a.cc:46:50: error: reference to 'map' is ambiguous 46 | if(0 <= nx && nx < W && 0 <= ny && ny < H && map[ny][nx]=='#') { // && x <= nx && y <= ny){ | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~ a.cc: In function 'int main()': a.cc:59:12: error: reference to 'map' is ambiguous 59 | cin >> map[i]; | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~ a.cc:66:10: error: reference to 'map' is ambiguous 66 | if(map[i][j]=='#'){ | ^~~ /usr/include/c++/14/bits/stl_map.h:102:11: note: candidates are: 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map' 102 | class map | ^~~ a.cc:9:8: note: 'std::string map [10]' 9 | string map[10]; | ^~~
s708096731
p03937
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); try { int h = sc.nextInt(); int w = sc.nextInt(); int count_w = 0; int count_h = 0; boolean flg = false; for (int i = 0; i < h; i++) { String str = sc.next(); for (int j = 0; j < w; j++) { char ch = str.charAt(j); if (ch == '#') { count_w++; flg = true; } } if (flg) { count_h++; } flg = false; } if (count_h > 2 * (h - 1) || count_w > 2 * (w - 1)) { System.out.println("Impossible"); } else { System.out.println("Possible"); } } finally { sc.close(); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s595773276
p03937
C
#include <stdio.h> #include <stdlib.h> #include <memory.h> char** alloc_masu(int H, int W){ int i; char** A; A = malloc(sizeof(char*)*H); for(i=0;i<H;i++){ A[i] = malloc(sizeof(char)*(H+1)); } return A; } int evaluate_masu(char** A, int H, int W){ int i=0, j=0; int bottomtrack,righttrack; int toptrack, lefttrack; while((i<H&&j<W)){ bottomtrack = (i==H-1?0:A[i+1][j] == '#'); righttrack = (j==W?0:A[i][j+1] == '#'); toptrack = (i==0?0:A[i-1][j] == '#'); lefttrack = (j==0?0:A[i][j-1] == '#'); if(righttrack&&bottomtrack)return 0; if(lefttrack&&toptrack)return 0; if(i==H-1&&j==W-1)return 1; if(righttrack)j++; if(bottomtrack)i++; } return 0; }
/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
s745204430
p03937
C++
// AtCoder.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include<stdio.h> #include<string.h> #include<math.h> int main(void){ int h,w; int a[10][10]; int i,j; char buff; int flag; int k; int f_w; int f_h; scanf("%d %d",&h,&w); for(i=0;i<h;i++){ for(j=0;j<w;j++){ scanf("%c",&buff); if(buff == '#'){ a[i+1][j+1] = 1; } else{ a[i+1][j+1] = 0; } } } flag = 0; for(i=0;i<h;i++){ for(j=0;j<w;j++){ if(a[i+1][j+1] == 1){ if(a[i][j+1] == 0){ if(a[i+1][j] == 0){ flag = 1; } } } } if(flag==0){ printf("Possible\n"); } else{ printf("Impossible\n"); } return 0; }
a.cc: In function 'int main()': a.cc:50:2: error: expected '}' at end of input 50 | } | ^ a.cc:9:15: note: to match this '{' 9 | int main(void){ | ^
s760816540
p03937
C++
#include <bits/stdc++.h> //#include <boost/functional/hash.hpp> //example: unordered_set< pair<int,int>,boost::hash< std::pair<int, int> > > used; //priority_queue< pair<int,pair<int,int> >, vector<pair<int,pair<int,int>>>, greater<pair<int,pair<int,int> > > > pqueue; //cost, vertex(行き先) using namespace std; #define MODULE 1000000007 #define MP make_pair #define ALL(v) (v).begin(),(v).end() #define fi first #define se second template<class T, class U> inline void chmin(T &t, U f) { if (t > f)t = f; } template<class T, class U> inline void chmax(T &t, U f) { if (t < f)t = f; } template<typename A, size_t N, typename T> inline void Fill(A (&array)[N], const T &val) { //usage: int dp[10][10]; Fill(dp,INF); std::fill((T *) array, (T *) (array + N), val); } typedef pair<int, int> P; typedef long long LL; const int INF = INT_MAX / 2; //int_max->2*e+9 LLの時はLLONG_MAX /*const int MAXN = 100001; struct edge { edge(int to, int cost) : to(to), cost(cost) {} int to, cost; }; vector<edge> graph[MAXN];*/ int dx[2] = {0, 1}; int dy[2] = {1, 0}; //-----Template--------- int h, w; string tmp; char grid[10][10]; bool isMovable(int x, int y) { /*for (int i = 0; i < h; ++i) { int lim = i < x ? w : y; for (int j = 0; j < lim; ++j) { if (grid[i][j] == '#') return false; } } return true;*/ } bool isValid(int x, int y) { return 0 <= x && x < h && 0 <= y && y < w; } bool bfs(int sx, int sy, int gx, int gy) { std::queue<P> qu; qu.push(P(sx, sy)); while (!qu.empty()) { P now = qu.front(); qu.pop(); if (now.first == gx && now.second == gy) break; for (int i = 0; i < 2; i++) { int x = now.first + dx[i]; int y = now.second + dy[i]; if (0 <= x && x < h && 0 <= y && y < w && grid[x][y] == '#') { if (x == gx && y == gy) return true; qu.push(P(x, y)); } if ((isValid(now.first + 1, now.second) && (grid[now.first + 1][now.second] == '#')) == (isValid(now.first, now.second + 1) && (grid[now.first][now.second + 1] == '#')) return false;//両方イケたら終わり } } return false; } int main() { ios::sync_with_stdio(false); //cout<< fixed << setprecision(10); cin >> h >> w; for (int i = 0; i < h; ++i) { cin >> tmp; for (int j = 0; j < w; ++j) { grid[i][j] = tmp[j]; } } cout << (bfs(0, 0, h - 1, w - 1) ? "Possible" : "Impossible") << endl; }
a.cc: In function 'bool isMovable(int, int)': a.cc:51:1: warning: no return statement in function returning non-void [-Wreturn-type] 51 | } | ^ a.cc: In function 'bool bfs(int, int, int, int)': a.cc:75:100: error: expected ';' before 'return' 75 | == (isValid(now.first, now.second + 1) && (grid[now.first][now.second + 1] == '#')) | ^ | ; 76 | return false;//両方イケたら終わり | ~~~~~~ a.cc:78:9: error: expected primary-expression before '}' token 78 | } | ^ a.cc:76:30: error: expected ')' before '}' token 76 | return false;//両方イケたら終わり | ^ | ) 77 | 78 | } | ~ a.cc:74:16: note: to match this '(' 74 | if ((isValid(now.first + 1, now.second) && (grid[now.first + 1][now.second] == '#')) | ^ a.cc:78:9: error: expected primary-expression before '}' token 78 | } | ^
s170576400
p03937
C++
#include <iostream> using namespace std; int main() { int r,c; cin >> r >> c; int sr, sc; int er, ec; int c; char ch; bool first = false; for (int i = 0; i < r; ++i) { for (int j = 0; j < c; ++j) { char ch; cin >> ch; if (ch == '#') { if (!first) { sr = r; sc = c; first = true; } er = r; ec = c; c += i + j; } } } if (!first) cout << "Impossible" << endl; else { int dr = er - sr; int dc = ec - sc; int rightc = dr * (dr + 1) / 2 + dc * (dc + 1) / 2 + dr * sr + dc * sc; if (c != rightc) cout << "Impossible" << endl; else cout << "Possible" << endl; } }
a.cc: In function 'int main()': a.cc:10:9: error: redeclaration of 'int c' 10 | int c; | ^ a.cc:5:11: note: 'int c' previously declared here 5 | int r,c; | ^