QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#544180#9220. Bus AnalysiswyxqwqWA 145ms9156kbC++142.5kb2024-09-02 11:23:022024-09-02 11:23:02

Judging History

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

  • [2024-09-02 11:23:02]
  • 评测
  • 测评结果:WA
  • 用时:145ms
  • 内存:9156kb
  • [2024-09-02 11:23:02]
  • 提交

answer

#include<bits/stdc++.h>
#define vectorwyx maze
namespace vectorwyx{
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define sml(x,y) (x=min(x,y))
#define big(x,y) (x=max(x,y))
#define ll long long
#define uint unsigned
#define ull unsigned long long
#define umap unordered_map
#define db double
#define fo(i,x,y) for(int i=(x);i<=(y);++i)
#define go(i,x,y) for(int i=(x);i>=(y);--i)
#define ptc putchar
#define gtc getchar
#define emp emplace
#define re return
#define co continue
#define brk break
#define HH (ptc('\n'))
#define bctz __builtin_ctz
#define bclz __builtin_clz
#define bppc __builtin_popcount
using namespace std;
ll seed=chrono::system_clock::now().time_since_epoch().count();
mt19937 rnd(seed);
inline int rm(int x,int y){return (int)(rnd()%(y-x+1ll)+x);}
inline int read(){signed ch=getchar();int x=0,f=1;while(!isdigit(ch)){if(ch==(int)('-'))f=-1;ch=getchar();}while(isdigit(ch)){x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}return x*f;}
template<typename T> void out(T *a,int l,int r){fo(i,l,r) cout<<*(a+i)<<' ';puts("");}

const int N=1005,mod=1e9+7;
#define modS(x) (x=x>=mod?x-mod:x)
#define add(x,y) (x+=y,modS(x))
int a[N],n;
pii f[75][75][75],g[75][75][75];

void Add(pii &x,pii &y){add(x.fi,y.fi),add(x.se,y.se);}

signed main(){
    cin>>n;fo(i,1,n) a[i]=read();
    f[0][0][0]=mk(1,0);
    fo(i,1,n){
        fo(j,0,74) fo(k,j,74) fo(w,k,74) g[j][k][w]=mk(0,0);
        fo(j,0,74) fo(k,j,74) fo(w,k,74) if(f[j][k][w].fi){
            int d=a[i]-a[i-1];
            Add(g[max(0,j-d)][max(0,k-d)][max(0,w-d)],f[j][k][w]);
            if(j>=d){
                Add(g[j-d][k-d][w-d],f[j][k][w]);
                co;
            }
            f[j][k][w].se+=f[j][k][w].fi;
            Add(g[max(19,k-d)][max(39,w-d)][74],f[j][k][w]);
            /*if(w<d) Add(g[19][39][74],f[j][k][w]);
            else if(k<d) Add(g[19][max(39,w-d)][74],f[j][k][w]);
            else if(j<d) Add(g[max(19,k-d)][max(39,w-d)][74],f[j][k][w]);
            if(a[i-1]+j<a[i]){
                int x1=max(19,k-(a[i]-a[i-1])),x2=max(w+a[i-1]-a[i],max(39,k+a[i-1]+20-a[i]));
                int x3=;
            }*/
        }
        fo(j,0,74) fo(k,j,74) fo(w,k,74) f[j][k][w]=g[j][k][w];
    }
    int ans=0;
    fo(j,0,74) fo(k,j,74) fo(w,k,74) add(ans,f[j][k][w].se);
    cout<<ans*2%mod;
    return 0;
}
}
/*
3
1 8 20
-------------------------------------------------
*/










signed main(){re vectorwyx::main();}

详细

Test #1:

score: 100
Accepted
time: 2ms
memory: 9012kb

input:

3
1 8 20

output:

14

result:

ok 1 number(s): "14"

Test #2:

score: 0
Accepted
time: 2ms
memory: 9052kb

input:

5
25 45 65 85 1000000000

output:

156

result:

ok 1 number(s): "156"

Test #3:

score: -100
Wrong Answer
time: 145ms
memory: 9156kb

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:

398232345

result:

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