Submission #338091

#TimeUsernameProblemLanguageResultExecution timeMemory
338091juggernautEnergetic turtle (IZhO11_turtle)C++14
40 / 100
2094 ms262148 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll dp[2005][2005][21],mod,a[2005][2005]; int n,m,k,t; int main(){ scanf("%d%d%d%d%lld",&n,&m,&k,&t,&mod); while(k--){ int x,y; scanf("%d%d",&x,&y); a[x+1][y+1]=1; } dp[1][0][0]=1; for(int i=1;i<=n+1;i++) for(int j=1;j<=m+1;j++) if(a[i][j])for(int l=1;l<=t;l++)dp[i][j][l]=(dp[i-1][j][l-1]+dp[i][j-1][l-1])%mod; else for(int l=0;l<=t;l++)dp[i][j][l]=(dp[i-1][j][l]+dp[i][j-1][l])%mod; ll res=0; for(int i=0;i<=t;i++)res=(res+dp[n+1][m+1][i])%mod; printf("%lld",res); }

Compilation message (stderr)

turtle.cpp: In function 'int main()':
turtle.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    7 |     scanf("%d%d%d%d%lld",&n,&m,&k,&t,&mod);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
turtle.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 |         scanf("%d%d",&x,&y);
      |         ~~~~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...