結果
問題 | No.1475 時計の歯車Easy |
ユーザー |
|
提出日時 | 2021-04-25 20:44:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,402 bytes |
コンパイル時間 | 1,366 ms |
コンパイル使用メモリ | 166,036 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 09:34:53 |
合計ジャッジ時間 | 2,537 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 42 |
ソースコード
#include<bits/stdc++.h>using namespace std;using ll [[maybe_unused]] = long long;using ld [[maybe_unused]] = long double;using vl [[maybe_unused]] = vector<ll>;#define rep(i,n) for(int i=0; i<(int)(n); ++i)#define rep_r(i,n) for(int i=(int)(n)-1; i>=0; --i)#define reps(i,n,m) for(ll i=(ll)(n); i<(ll)(m); ++i)#define reps_r(i,n,m) for(ll i=(ll)(m)-1; i>=(ll)(n); --i)#define rep_a(i,I) for(const auto& i:I)#define debuglist(a) {cerr<<#a<<":";for(auto _e:a){cerr<<" "<<_e;}cerr<<"\n";}#define debug(x) cerr<<#x<<": "<<x<<"\n"#define ans_exit(x) {cout<<x<<"\n"; exit(0);}#define ans_return(x) {cout<<x<<"\n"; return;}#define SIZE(obj) ll(obj.size())#define ALL(obj) (obj).begin(), (obj).end()#define rALL(obj) (obj).rbegin(), (obj).rend()#define INF32 2147483647#define INF64 9223372036854775807#define MOD 1000000007void mysort(int a[],int n){int max,tmp;for(int i=0; i<n-1; ++i){max=i;for(int j=i+1; j<n; ++j){if(a[max]<a[j]) max=j;}tmp=a[i];a[i]=a[max];a[max]=tmp;}}int main(){//cout<<fixed<<setprecision(10);ios::sync_with_stdio(false);cin.tie(nullptr);int n,k,l[20];cin>>n;while(n--){cin>>k;for(int i=0; i<k; ++i) cin>>l[i];mysort(l,k);for(int i=0; i<k-1; ++i) cout<<l[i]<<" ";cout<<l[k-1]<<"\n";}}