結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2018-03-24 23:38:42 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 904 ms |
コンパイル使用メモリ | 80,460 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-25 03:19:11 |
合計ジャッジ時間 | 1,840 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 21 |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<cmath> #include<iomanip> #include<cstring> #include<map> #include<vector> #include<queue> #include<climits> using namespace std; typedef long long int ll; int main(){ ll n, a[4000]={0}; cin >> n; for(int i=0; i<n; i++){ cin >> a[i]; } for(int i=0; i<=2*n-3; i++){ for(int j=0; j<=i; j++){ if(a[j]>a[i-j]){ int tmp=a[j]; a[j]=a[i-j]; a[i-j]=tmp; } } } for(int i=n-1; 0<=i; i--){ cout << a[i] <<" "; } cout << endl; return 0; }