2 solutions

  • 0
    @ 2025-5-25 10:13:48
    #include<stdio.h>
    
    int a[100006];
    int main()
    {
        int t;scanf("%d",&t);
        while(t--)
        {
            int n;
            scanf("%d",&n);
            for(int i=1;i<=n;i++)
                scanf("%d",&a[i]);
            for(int i=n;i>=1;i--)
                if(a[i]==n)
                    n--;
            printf("%d\n",n);
        }
    }
    • 0
      @ 2024-5-8 16:42:57

      image image image

      • 1

      Information

      ID
      196
      Time
      1000ms
      Memory
      64MiB
      Difficulty
      5
      Tags
      (None)
      # Submissions
      43
      Accepted
      17
      Uploaded By