CodeForces 1143A The Doors

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;
}

猜你喜欢

转载自www.cnblogs.com/dacc123/p/10687536.html
今日推荐