結果
問題 | No.490 yukiソート |
ユーザー |
|
提出日時 | 2017-06-15 22:48:33 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 925 bytes |
コンパイル時間 | 633 ms |
コンパイル使用メモリ | 87,292 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-25 03:10:09 |
合計ジャッジ時間 | 4,192 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)break;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;}