Problem: link Code in c++ which produces different output for k=10^5. Same logic in python giving AC.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
long long p = 1e9+7;
int main(){
ll k;cin>>k;
ll i,j,dp[100005], par[2] = {1,0};
for(i=1;i<k+1;i++){
dp[i]+=(par[(i+1)%2])%p;
par[i%2]+=(dp[i])%p;
}
cout<<dp[k]%p<<endl;
}