QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#676212#9220. Bus Analysis11d10xyWA 403ms10736kbC++14789b2024-10-25 20:39:332024-10-25 20:39:40

Judging History

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

  • [2024-10-25 20:39:40]
  • 评测
  • 测评结果:WA
  • 用时:403ms
  • 内存:10736kb
  • [2024-10-25 20:39:33]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64=long long;
constexpr i64 mod=1000000007;
int n;
i64 f[76][76][76],pw[1010],ans;
int main(){
   scanf("%d",&n);
   pw[0]=1;for(int i=1;i<=n;i++)pw[i]=pw[i-1]*2%mod;
   int lst=0;
   f[0][20][40]=1;
   for(int t;n--;){
      scanf("%d",&t);
      int d=t-lst;
      i64 g[76][76][76]{};
      for(int x=0;x<=75;x++)for(int y=x+20;y<=75;y++)for(int z=y+20;z<=75;z++){
         int a=max(x-d,0),b=max(y-d,0),c=max(z-d,0);
         if(a)(g[a][b][c]+=f[x][y][z]*2)%=mod;
         else(g[max(b,20)][max({c,b+20,40})][max({75,b+40,c+20})]+=f[x][y][z])%=mod,(g[0][20][40]+=f[x][y][z])%=mod,(ans+=f[x][y][z]*pw[n])%=mod;
      }
      memcpy(f,g,sizeof(g));
      lst=t;
   }
   printf("%lld",ans*2%mod);
   return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 4ms
memory: 10660kb

input:

3
1 8 20

output:

14

result:

ok 1 number(s): "14"

Test #2:

score: 0
Accepted
time: 5ms
memory: 10736kb

input:

5
25 45 65 85 1000000000

output:

156

result:

ok 1 number(s): "156"

Test #3:

score: -100
Wrong Answer
time: 403ms
memory: 10664kb

input:

1000
2 7 9 12 14 17 18 21 22 28 29 33 34 35 37 38 44 45 46 50 58 59 63 66 71 72 75 76 77 78 80 81 83 84 87 92 100 101 107 108 109 112 114 116 118 123 124 131 142 143 144 145 148 150 151 152 153 155 157 158 165 167 168 169 171 176 182 185 190 192 198 202 204 205 212 213 223 224 225 226 229 231 240 24...

output:

210097884

result:

wrong answer 1st numbers differ - expected: '932594593', found: '210097884'