結果

問題 No.490 yukiソート
ユーザー wildwild
提出日時 2017-03-10 22:41:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 414 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 71,164 KB
実行使用メモリ 75,544 KB
最終ジャッジ日時 2023-09-06 15:45:52
合計ジャッジ時間 29,341 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 14 ms
4,376 KB
testcase_05 AC 14 ms
4,376 KB
testcase_06 AC 14 ms
4,376 KB
testcase_07 AC 13 ms
4,380 KB
testcase_08 AC 13 ms
4,376 KB
testcase_09 AC 13 ms
4,376 KB
testcase_10 AC 13 ms
4,376 KB
testcase_11 AC 14 ms
4,380 KB
testcase_12 AC 14 ms
4,376 KB
testcase_13 AC 14 ms
4,380 KB
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 1 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,504 KB
testcase_34 AC 1 ms
4,384 KB
testcase_35 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

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

	for(int i=1; i<2*n-3; i++){
		for(int j=0; j<i; j++){
			for(int k=j+1; k<n; k++){
				if(k+j == i && v[j] > v[k]){
					int tmp = v[j];
					v[j] = v[k];
					v[k] = tmp;
				}
			}
		}
	}

	for(int i: v){
		cout << i << " ";
	}
	cout << endl;
}

0