結果

問題 No.490 yukiソート
ユーザー focus
提出日時 2018-03-30 10:15:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 945 ms
コンパイル使用メモリ 81,248 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-26 00:21:45
合計ジャッジ時間 1,845 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 2 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include<vector>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
using namespace std;
int main (void) {
    long long int j,n,num;
    cin >> n;
    vector<long long int> a(n);
    for(long long int i=0;i<n;i++)    cin >> a[i];
    for(long long int x=1;x<2*n-3;x++){
        for(long long int i=0;i<n;i++){
            j = n-i;
            if(i<j&&a[j]+a[i]==x&&a[i]>a[j]) swap(a[i],a[j]);
            
        }
    }
    for(long long int i=0;i<n;i++)    cout << a[i] << " ";
    cout << endl;
    return 0;
}
0