求USACO银组第二题题意
  • 板块学术版
  • 楼主SunLegend
  • 当前回复3
  • 已保存回复3
  • 发布时间2023/12/16 18:40
  • 上次更新2023/12/16 18:44:25
查看原帖
求USACO银组第二题题意
461452
SunLegend楼主2023/12/16 18:40

翻译软件用了还是看不懂,循环(cycle)到底是什么意思,标签(label)又是怎么贴的?

附题目: Farmer John has N barns (3≤N≤5⋅105), of which K (3≤K≤N) distinct pairs of barns are connected.

First, Annabelle assigns each barn a distinct integer label in the range [1,N] , and observes that the barns with labels a1,…,aK are connected in a cycle, in that order. That is, barns ai and ai+1 are connected for all 1≤i<K , and barns aK and a1 are also connected. All ai are distinct.

Next, Bessie also assigns each barn a distinct integer label in the range [1,N] and observes that the barns with labels b1,…,bK are connected in a cycle, in that order. All b i are distinct.

Some (possibly none or all) barns are assigned the same label by Annabelle and Bessie. Compute the maximum possible number of barns that are assigned the same label by Annabelle and Bessie.

2023/12/16 18:40
加载中...