結果

問題 No.490 yukiソート
コンテスト
ユーザー mMqrMruYrNII4Td
提出日時 2017-03-10 22:33:48
言語 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
結果
WA  
実行時間 -
コード長 574 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 467 ms
コンパイル使用メモリ 73,992 KB
実行使用メモリ 16,072 KB
最終ジャッジ日時 2026-03-10 12:26:39
合計ジャッジ時間 31,983 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 3 WA * 21 TLE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

ll a[5001];

int main(){
	int n;
	
	cin >> n;
	
	REP(i,n) scanf("%lld", &a[i]);
	
	FOR(i,1,2*n-3){
		REP(p,n){
			REP(q,n){
				if (p+q == i){
					if (a[p] > a[q]){
						int tmp = a[p];
						a[p] = a[q];
						a[q] = a[p];
					}
				}
			}
		}
	}
	
	REP(i,n){
		printf("%lld", a[i]);
		if (i != n-1) printf(" ");
		else puts("");
	}
	
	return 0;
}
0