| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 15479 | 陈颖钧 | 数池塘(四方向) | C++ | Wrong Answer | 0 | 1 MS | 260 KB | 609 | 2026-02-06 09:04:31 |
#include<bits/stdc++.h> using namespace std; int n,m,i,j,tx,ty,s; char a[110][110]; int fx[4]={-1,1,0,0}; int fy[4]={0,0,-1,1}; void dfs(int x,int y){ a[x][y]='.'; for(int k=0;k<4;k++){ tx=x+fx[k]; ty=y+fy[y]; if(tx>=1&&tx<=n&&ty>=1&&ty<=m&&a[tx][ty]=='W'){ dfs(tx,ty); } } } int main(){ cin>>n>>m; for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ cin>>a[i][j]; } } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(a[i][j]=='W'){ dfs(i,j); } } } }