結果
問題 |
No.490 yukiソート
|
ユーザー |
![]() |
提出日時 | 2017-03-10 23:33:10 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 509 bytes |
コンパイル時間 | 776 ms |
コンパイル使用メモリ | 71,488 KB |
実行使用メモリ | 13,764 KB |
最終ジャッジ日時 | 2024-06-24 10:26:05 |
合計ジャッジ時間 | 4,621 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 8 WA * 6 TLE * 1 -- * 19 |
ソースコード
#include <iostream> #include <algorithm> #include <string> #include <queue> #include <set> #include <map> #include <cstdio> #include <cmath> #define rep(i,a,b) for(int (i)=(a);i<(b);i++) #define INF 100000000 using namespace std; int main(){ int n,a[5010]; cin>>n; rep(i,0,n)cin>>a[i]; rep(i,1,2*n-2){ rep(j,0,n){ rep(k,0,n){ if(j+k==i&&a[j]<a[k])swap(a[j],a[k]); } } } rep(i,0,n)cout<<a[i]<<" "; return 0; }