Submission #1149078

#TimeUsernameProblemLanguageResultExecution timeMemory
1149078weakweakweakPatkice (COCI20_patkice)C11
Compilation error
0 ms0 KiB
//簽到題 #include <bits/stdc++.h> using namespace std; #define pii pair<int,int> #define fs first #define sc second int n, m, dx[4]={0,0,1,-1}, dy[4]={1,-1,0,0}; pii st, ed; string s[110]; int fa[210000]={0}; int f(int x, int y){return x*m+y+100000;} inline int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);} inline void uni(int x, int y){ x=find(x),y=find(y); if(x!=y)fa[x]=y; } bool y=0; void finish(string s){ cout << ":)\n"; cout << s; y=1; } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> m; for(int i=0; i<210000; i++)fa[i]=i; for(int i=0; i<n; i++){ cin >>s[i]; } for (int i = 0; i < n; i++) { for(int j=0; j<m; j++){ if(s[i][j]=='x')ed={i,j}; else if(s[i][j]=='o')st={i,j}; else if(s[i][j]=='>' and (j==m-1 or s[i][j+1] != 'o'))uni(f(i,j),f(i,j+1)); else if(s[i][j]=='<' and (j == 0 or s[i][j-1] != 'o'))uni(f(i,j),f(i,j-1)); else if(s[i][j]=='v' and (i==n-1 or s[i+1][j] != 'o'))uni(f(i,j),f(i+1,j)); else if(s[i][j]=='^' and (i == 0 or s[i-1][j] != 'o'))uni(f(i,j),f(i-1,j)); } } if(find(f(st.fs,st.sc+1))==find(f(ed.fs,ed.sc)))finish("E\n"); if(find(f(st.fs-1,st.sc))==find(f(ed.fs,ed.sc)))finish("N\n"); if(find(f(st.fs+1,st.sc))==find(f(ed.fs,ed.sc)))finish("S\n"); if(find(f(st.fs,st.sc-1))==find(f(ed.fs,ed.sc)))finish("W\n"); if(!y)cout << ":(\n"; }

Compilation message (stderr)

patkice.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.