結果
問題 |
No.490 yukiソート
|
ユーザー |
|
提出日時 | 2017-06-15 22:40:05 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 926 bytes |
コンパイル時間 | 647 ms |
コンパイル使用メモリ | 86,532 KB |
実行使用メモリ | 16,952 KB |
最終ジャッジ日時 | 2024-09-25 03:09:22 |
合計ジャッジ時間 | 7,018 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 33 |
ソースコード
#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); } bool f = 0; while (!f) { f = 0; for (int i = 0; i < n; i++) { for (int j = 0; j + i < 2 * n - 3; j++) { if (j >= i - j)break; if (a[j] > a[i - j]) { swap(a[j], a[i - j]); f = 1; } } /* 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; }