結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-11 00:56:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 452 bytes |
| コンパイル時間 | 802 ms |
| コンパイル使用メモリ | 73,548 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-24 10:38:53 |
| 合計ジャッジ時間 | 1,632 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int n, tmp;
cin >> n;
vector<int> v;
for(int i=0; i<n;i++){
cin >> tmp;
v.push_back(tmp);
}
for(int i=1; i<2*n-3; i++){
for(int j=0; j<=i/2; j++){
if(i-j >= n) continue;
//cout << j << "\t" << i-j << endl;
if(v[j] > v[i-j]){
tmp = v[j];
v[j] = v[i-j];
v[i-j] = tmp;
}
}
}
for(int i:v) cout<< i << " ";
cout << endl;
}