版本比较
ARC108E
正文
增加 4 行删除 4 行
17 行未改动1819202122222324252611 行未改动383940414242434445464748495051515253545515 行未改动7172737475757617 行未改动const int NR=2e3+10;const int MOD=1e9+7;#define int long longint n,a[NR],f[NR][NR];void add(int &x,int y){x=(x+y)%MOD;} void add(int &x,int y){x=(x+y)%MOD;}
int quickpow(int x,int y){ int res=1; while(y){11 行未改动 } void modify(int x,int y){ while(x<=n){ add(c[x],y); x+=lowbit(x); x+=lowbit(x); } } int ask(int x){ int res=0; while(x){ add(res,c[x]); x-=lowbit(x); } return res; return res; } int calc(int l,int r){ if(l>r)return 0; return ask(r)-ask(l-1);15 行未改动 t1[l].modify(a[r],f[l][r]);t2[r].modify(a[l],f[l][r]); } cout<<(f[1][n]+MOD)%MOD<<endl; return 0;} }```