5 条题解

  • 0
    @ 2024-12-14 21:52:21

    是这样的

    #include using namespace std; int a[10005]; int main() { ios::syne_with_stdio(false); cout.tie(0); cin.tie(0); int x; cin>>x; int res=1; a[res]=x; while(cin>>x) { sort(a+1,a+res); if(a[res]<x) { res++; a[res]=x; } else a[lower_bound(a+1,a+res,x)-a]=x; } cout<<res;

    • @ 2024-12-14 21:53:11

      未知原因,发不出来代码啊,无法分行

  • 0
    @ 2024-12-5 21:10:12

    666

    • 0
      @ 2023-12-22 20:45:55

      #include<stdio.h> #include<algorithm> using namespace std; int a[100005]; int main(){ int i=0,m; int sum=2; while(scanf("%d",&m)!=EOF) { a[i]=m; i++; } int k=a[0]; for(int j=0;j<i;j++) {

      if(a[j+1]>k)
      	{
      		sum++;
      		k=a[j+1];
      	}	
      }
      printf("%d",sum);
      return 0;
      

      }应该不需要太麻烦吧

      • 0
        @ 2023-12-14 15:35:20

        #include<stdio.h> const int N = 10000; int sum = 0, i = 0, n = 0, m; void sort(int b[], int n) { int x; for(int j = 0 ; j < n - 1 ; j ++) { int m = b[j]; for(int k = j + 1 ; k < n ; k ++) { if(m >= b[k]) { m = b[k]; x = k; } } b[x] = b[j]; b[j] = m; } } int fun(int x, int b[], int n) { if(n == 0) b[n] = x; for(int j = 0 ; j < n ; j ++) { if(b[j] >= x) { b[j] = x; return 0; } } b[n] = x; return 1; } int main() { int a[N], b[N]; while(scanf("%d",&m)!=EOF) { a[i] = m; i ++; n ++; } i = 0; for(int j = 1 ; j < n ; j ++) { if(fun(a[j], b, i)) sum ++; i ++; sort(b,i); } printf("%d",sum); }

        • 0
          @ 2023-12-12 22:15:38

          玩原神玩的

          • 1

          信息

          ID
          881
          时间
          1000ms
          内存
          256MiB
          难度
          9
          标签
          递交数
          110
          已通过
          17
          上传者