1 solutions
-
0
C++ :
#include <bits/stdc++.h> using namespace std; int main(){ int n,x,a[100],i; cin>>n; for(i = 0;i < n;i++){ cin>>a[i]; } sort(a,a+n); for(i = n - 1;i >= 0;i--){ cout<<a[i]; } }
Python :
class Node: def __init__(self,id): self.id=id def __lt__(self,other): if str(self.id)+str(other.id)>str(other.id)+str(self.id): return True n=int(input()) s=list(map(int,input().split())) lst=list() s.sort(reverse=True) for item in s: lst.append(Node(item)) lst.sort() for item in lst: print(item.id,end="")
- 1
Information
- ID
- 10447
- Time
- 1000ms
- Memory
- 32MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By