5 条题解

  • 2
    @ 2023-7-11 15:00:26

    感觉不如……

    #include <bits/stdc++.h>
    using namespace std;
    
    class cmp
    {
        public:
            bool operator()(const int v1,const int v2) const
            {
                return v1<v2;
            }
    };
    set<int,cmp> p;
    
    int main()
    {
        int a;
        while(cin >> a) p.insert(a);
        //sort(p.begin(),p.end());
        for(auto x:p) cout << x << " ";
        return 0;
    }
    
    • 2
      @ 2023-3-5 14:27:29
      C++

      Florance

      冒泡好麻烦 还得是桶排

      #include <bits/stdc++.h>
      using namespace std;
      int main(){
          int a[100];
          int x;
          while(cin >> x) {
              a[x] = 1;
          }
          for(int i = 0; i < 100; i++) {
              if(a[i]) cout << i << " ";
          }
          return 0;
      }
      
      • 0
        @ 2024-12-5 11:48:37

        奇技淫巧

        a=list(map(int,input().split(" ")))
        a=list(set(a))
        a.sort()
        for i in a:
            print(i,end=" ")
        
        • -1
          @ 2024-12-4 11:51:11
          a=list(map(int,input().split()))
          n=len(a)
          bottom=n-1
          for i in range(1,n):
              for j in range(bottom,i-1,-1):
                  if a[j]<a[j-1]:
                      a[j],a[j-1]=a[j-1],a[j]
                  elif a[j]==a[j-1]:
                      a[j]=a[bottom]
                      bottom-=1
          for i in range(bottom+1):
              print(a[i],end=" ")
          
          • -2
            @ 2024-12-4 11:51:27
            a=list(map(int,input().split()))
            n=len(a)
            b=[]
            bottom=n-1
            for i in range(1,n):
                for j in range(bottom,i-1,-1):
                    if a[j]<a[j-1]:
                        a[j],a[j-1]=a[j-1],a[j]
                    elif a[j]==a[j-1]:
                        a[j]=a[bottom]
                        bottom-=1
            for i in range(bottom+1):
                print(a[i],end=" ") 
            
            • 1

            信息

            ID
            806
            时间
            1000ms
            内存
            256MiB
            难度
            5
            标签
            递交数
            736
            已通过
            281
            上传者