QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#676199 | #9220. Bus Analysis | 11d10xy | WA | 402ms | 10808kb | C++14 | 782b | 2024-10-25 20:38:03 | 2024-10-25 20:38:04 |
Judging History
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,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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 10680kb
input:
3 1 8 20
output:
14
result:
ok 1 number(s): "14"
Test #2:
score: 0
Accepted
time: 5ms
memory: 10808kb
input:
5 25 45 65 85 1000000000
output:
156
result:
ok 1 number(s): "156"
Test #3:
score: -100
Wrong Answer
time: 402ms
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'