結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-15 22:45:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 904 bytes |
| コンパイル時間 | 667 ms |
| コンパイル使用メモリ | 85,264 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-25 03:10:00 |
| 合計ジャッジ時間 | 4,182 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 RE * 20 |
ソースコード
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
//#include<bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int>a;
vector<int>x[2005];
for (int i = 0; i < n; i++) {
int t;
cin >> t;
a.push_back(t);
x[t].push_back(i);
}
for (int i = 0; i < 2*n-3; i++) {
for (int j = 0; j<=i; j++) {
int y = i - j;
if (j < y&&y <= n - 1) {
if (a[j] > a[i - j]) {
swap(a[j], a[i - j]);
}
}
}
/*
for (int k = 0; k < n; k++) {
cout << a[k] << " ";
}
cout << endl;
*/
}
for (int k = 0; k < n; k++) {
if (k)cout << " ";
cout << a[k];
}
cout << endl;
return 0;
}