求高人

LS_fengchixuan 2023-12-16 20:29:45 6 返回题目

俺不会

{{ vote && vote.total.up }}

共 1 条回复

LS_linzihan

#include <bits/stdc++.h> using namespace std; int n,m,a[10005]; int main() { scanf("%d",&n); m=0; for(int i=1,t,x,j; i<=n; i++) { scanf("%d%d",&t,&x); if(t==0) { for(j=m; j>=1; j--) if(a[j]>x) a[j+1]=a[j]; else break; a[j+1]=x; m++; } else printf("%d\n",a[x]); } return 0; }