結果
問題 | No.490 yukiソート |
ユーザー |
|
提出日時 | 2017-06-15 22:49:15 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 907 bytes |
コンパイル時間 | 666 ms |
コンパイル使用メモリ | 85,236 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-25 03:10:14 |
合計ジャッジ時間 | 1,701 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#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);}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;}