| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 15508 | 陈颖钧 | 有多少细胞 | C++ | Runtime Error | 0 | 2 MS | 1232 KB | 454 | 2026-03-07 19:16:20 |
#include<bits/stdc++.h> using namespace std; const int N=1e3; int i,j,n,m,s,tx,ty; char a[N][N]; int x[4]={1,-1,0,0}; int y[4]={0,0,1,-1}; int dfs(int n,int m){ if(tx==n&&ty==m){ return s; }else{ for(i=0;i<4;i++){ tx+=x[i]; ty+=y[i]; if(tx>0&&tx<=n&&ty>0&&ty<=m){ dfs(tx,ty); s++; } } } } int main(){ cin>>n>>m; for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ cin>>a[i][j]; } } cout<<dfs(n,m); }