A.3*3讨论即可,注意正方形套圆套三角形只有6个点。

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<iostream>
 4 #include<algorithm>
 5 #define rep(i,l,r) for (int i=(l); i<=(r); i++)
 6 typedef long long ll;
 7 using namespace std;
 8 
 9 const int N=110;
10 int n,ans,a[N];
11 
12 int main(){
13     scanf("%d",&n);
14     rep(i,1,n) scanf("%d",&a[i]);
15     rep(i,2,n){
16         if ((a[i-1]==2 && a[i]==3) || (a[i-1]==3 && a[i]==2)){ puts("Infinite"); return 0; }
17         if ((a[i-1]==1 && a[i]==2) || (a[i-1]==2 && a[i]==1)) ans+=3;
18         if ((a[i-1]==1 && a[i]==3) || (a[i-1]==3 && a[i]==1)) ans+=4;
19         if (i>=3 && a[i-2]==3 && a[i-1]==1 && a[i]==2) ans--;
20     }
21     printf("Finite\n%d\n",ans);
22     return 0;
23 }
A

相关文章:

  • 2021-09-09
  • 2021-09-04
  • 2021-06-26
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
猜你喜欢
  • 2021-12-23
  • 2020-07-14
  • 2021-10-15
  • 2021-06-18
  • 2021-09-18
  • 2021-07-21
相关资源
相似解决方案