QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#354961#2816. 过河卒二LVJBot1RE 0ms0kbC++14478b2024-03-16 09:57:542024-03-16 09:57:55

Judging History

你现在查看的是最新测评结果

  • [2024-03-16 09:57:55]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-03-16 09:57:54]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
using namespace std; const int fx[]={0,-2,-1,1,2,2,1,-1,-2}; const int fy[]={0,1,2,2,1,-1,-2,-2,-1}; int bx,by,mx,my; ll f[40][40]; bool s[40][40]; int main(){ scanf("%d%d%d%d",&bx,&by,&mx,&my); bx+=2;by+=2;mx+=2;my+=2; f[2][1]=1; s[mx][my]=1; for(int i=1;i<=8;i++) s[mx+fx[i]][my+fy[i]]=1; for(int i=2;i<=bx;i++){ for(int j=2;j<=by;j++){ if(s[i][j]) continue; f[i][j]=f[i-1][j]+f[i][j-1]; } } printf("%lld\n",f[bx][by]); return 0; }

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

input:

1737 2613 20
1695 2081
1449 1419
868 1636
879 2454
1400 1778
1364 2166
1343 1563
1229 2012
1308 1674
1712 2004
1392 1716
1118 1690
1693 1986
1641 2221
1454 1937
1554 1944
997 2083
1242 1503
990 1834
986 1438

output:


result: