結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2017-03-10 22:54:20 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 906 bytes |
コンパイル時間 | 1,305 ms |
コンパイル使用メモリ | 158,152 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 10:15:17 |
合計ジャッジ時間 | 2,458 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef vector<int> VI;typedef vector<VI> VVI;typedef vector<ll> VL;typedef vector<VL> VVL;typedef pair<int, int> PII;#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)#define REP(i, n) FOR(i, 0, n)#define ALL(x) x.begin(), x.end()#define MOD 1000000007#define INF (1LL<<25) //33554432#define PI 3.14159265359#define EPS 1e-12//#define int llint a[5010];signed main(void){int n;cin >> n;REP(i, n) cin >> a[i];FOR(i, 1, 2*n-3) {//cout << i << endl;REP(p, i+1) {if(p >= i-p) break;if(i-p >= n) continue;//cout << "a[" << p << "]:" << a[p] << " a[" << i-p << "]:" << a[i-p] << endl;if(a[p] > a[i-p]) swap(a[p], a[i-p]);}//REP(j, n) cout << a[j] << " "; cout << endl;}REP(i, n) {cout << a[i];if(i != n-1) cout << " ";}return 0;}