| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 102120 | 曾煦翔 | 救援顺序 | C++ | Accepted | 100 | 15 MS | 256 KB | 383 | 2023-09-12 13:32:03 |
#include<bits/stdc++.h> using namespace std; int n,a[1009],tp; int main() { cin>>n; for(int i = 1,x;i <= n;i++) { cin >> x; tp += (a[x] == 0); a[x]++; } for(int i = 1;i <= tp;i++) { int p = 0; for(int j = 1;j <= 1000;j++) if(a[j] > a[p]) p = j; if(i != tp) cout << p << "->"; else cout << p; a[p]=0; } return 0; }