fix: fixed wrong solution code

This commit is contained in:
2025-11-12 10:01:10 -03:00
parent b249c58ecf
commit 063c8815c7
105 changed files with 108 additions and 105 deletions

View File

@@ -2,6 +2,8 @@
typedef long long ll;
using namespace std;
const int MOD = 1e9 + 7;
int main(){
int N, M; cin >> N >> M;
@@ -15,11 +17,12 @@ int main(){
int opposite = (int)(!j);
for (int k = 1; k <= M && i + k <= N; k++) {
dp[i + k][opposite] += dp[i][j];
dp[i + k][opposite] %= MOD;
}
}
}
cout << dp[N][0] + dp[N][1] << endl;
cout << (dp[N][0] + dp[N][1]) % MOD << endl;
return 0;
}