結果

問題 No.490 yukiソート
コンテスト
ユーザー Yasufu12
提出日時 2017-03-10 22:58:51
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 475 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 309 ms
コンパイル使用メモリ 74,360 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-10 12:40:42
合計ジャッジ時間 1,202 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<algorithm>

using namespace std;

int n, a[5000];

int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}

	for (int i = 0; i < 2 * n - 3; i++){
		int p = 0;

		for (int j = 0; j < n; j++){
			if (i - j > j && i - j < n){
				if (a[j] > a[i - j]){
					int box = a[j];
					a[j] = a[i - j];
					a[i - j] = box;
				}
			}
		}
	}

	for (int i = 0; i < n - 1; i++){
		cout << a[i] << " ";
	}
	cout << a[n - 1] << "\n";

	return 0;
}
0