Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
49735 超人JAX 走方格 C++ 运行超时 20 1000 MS 720 KB 499 2024-07-31 20:30:02

Tests(2/10):


#include <bits/stdc++.h> using namespace std; int Map[35][35]={}; int a, b; int ans; void dfs(int x, int y) { if(x > 30 || y > 30 || !Map[x][y]) { return; } if(x == a && y == b) { ans++; return; } dfs(x+1, y); dfs(x, y+1); } int main(){ cin >> a >> b; for(int i=1; i<=30; i++) { for(int j=1; j<=30; j++) { if(i%2 || j%2) { Map[i][j] = 1; } } } if(a%2==0 && b%2==0) { cout << 0; return 0; } dfs(1, 1); cout << ans; return 0; }


测评信息: