Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
121407 吴宗桦 封闭面积问题 C++ 通过 100 0 MS 252 KB 449 2024-01-21 17:27:41

Tests(10/10):


#include<iostream> using namespace std; bool a[11][11], b[11][11]; int ans = 0; void f(int x, int y) { if(x < 0 || y < 0 || x >= 11 || y >= 11 || a[x][y] || b[x][y]) return; b[x][y] = true; ans++; f(x, y+1); f(x+1, y); f(x, y-1); f(x-1, y); } int main() { for(int i = 1; i <= 10; i++) { for(int j = 1; j <= 10; j++) { cin >> a[i][j]; if(a[i][j]) ans++; } } f(0, 0); cout << 121 - ans; return 0; }


测评信息: