結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2017-03-10 22:24:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 15 ms / 2,000 ms |
コード長 | 906 bytes |
コンパイル時間 | 891 ms |
コンパイル使用メモリ | 97,396 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 08:23:35 |
合計ジャッジ時間 | 2,337 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <iomanip> #include <time.h> #include <random> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) int main() { int n; cin >> n; vector<int> a; REP(i, n) { int tmp; cin >> tmp; a.push_back(tmp); } for (int i = 1;i < 2 * n - 3;++i) { for (int p = 0;p <= n - 1;++p) { int gyao = i - p; if (gyao > p&&gyao <= n - 1) { if (a[p] > a[gyao]) swap(a[p], a[gyao]); } } } REP(i, n) { cout << a[i] << " "; } cout << endl; return 0; }