Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoYuKai-SaMuEl committed Sep 25, 2024
1 parent 8ad495c commit d70cb21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pB/gen/gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inline int randomint(double l,double r){
int main(int argc, char* argv[]){
registerGen(argc, argv, 1);
int subtask=atoi(argv[1]),idx=atoi(argv[2]);
int n=(idx%2?rnd.next(1,99):100),m=10;
int n=(idx%2?rnd.next(1,99):100),m=10,sp=0;
cout<<n<<' '<<m<<'\n';
for(int i=0;i<n;i++)shufa[i]=i+1;
for(int i=0;i<m;i++)shufb[i]=i+1;
Expand All @@ -17,7 +17,8 @@ int main(int argc, char* argv[]){
for(int i=0;i<m;i++)t[i]=randomint(0,9);
for(int i=0;i<m;i++)cout<<t[i]<<" \n"[i==m-1];
for(int i=0;i<n;i++)for(int j=0;j<way[i];j++){
a[i][j]=(subtask==1||subtask==2?0:subtask==3||subtask==4?1:rnd.next(0,min(n,10)));
sp++;
a[i][j]=(subtask==1||subtask==2?0:subtask==3||subtask==4?1:idx%5!=0&&sp%5==1?0:rnd.next(0,min(n,10)));
cout<<a[i][j]<<' ';
shuffle(shufa,shufa+n);
for(int k=0;k<a[i][j];k++)cout<<shufa[k]<<' '<<rnd.next(1,10)<<" \n"[k==a[i][j]-1];
Expand Down
3 changes: 1 addition & 2 deletions pB/solution/correct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ int main(){
dis[i][j]=1e15;
in[i][j]=a[i][j];
for(int k=1;k<=b[i][j];k++)if((~per)&(1<<(z[i][j][k]-1)))in[i][j]++;
cout<<i<<' '<<j<<' '<<in[i][j]<<'\n';
}
}
queue<pair<int,int>>qu;//store the (item_id,way_id) which can be maken
Expand Down Expand Up @@ -59,5 +58,5 @@ int main(){
for(int i=1;i<=m;i++)if(per&(1<<(i-1)))tsum+=t[i];
for(int i=1;i<=n;i++)ans[i]=min(ans[i],now[i]+tsum);
}
for(int i=1;i<=n;i++)cout<<ans[i]<<'\n';
for(int i=1;i<=n;i++)cout<<(ans[i]!=1e15?ans[i]:-1)<<'\n';
}

0 comments on commit d70cb21

Please sign in to comment.