The Doors

签到题

#include <iostream>

using namespace std;

int a[200005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    
    int x=a[n-1];
    int pos=n-2;
    for(int i=n-2;i>=0;i--)
    {
        if(x!=a[i])
        {
            pos =i;
            break;
        }
    }
    printf("%d\n",pos+1);
    
    return 0;
}

相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2021-08-06
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2022-12-23
猜你喜欢
  • 2021-08-01
  • 2021-09-13
  • 2021-12-28
  • 2021-12-14
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案