結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2018-03-30 10:07:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 539 bytes |
コンパイル時間 | 716 ms |
コンパイル使用メモリ | 81,508 KB |
実行使用メモリ | 13,756 KB |
最終ジャッジ日時 | 2024-06-26 00:21:33 |
合計ジャッジ時間 | 4,875 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 4 WA * 10 TLE * 1 -- * 19 |
ソースコード
#include <iostream>#include<vector>#include<cstdio>#include<cmath>#include<algorithm>#include<map>#include<set>using namespace std;int main (void) {long long int n,num;cin >> n;vector<long long int> a(n);for(int i=0;i<n;i++) cin >> a[i];for(int x=1;x<2*n-3;x++){for(int i=0;i<n;i++){for(int j=i+1;j<n;j++){if(a[j]+a[i]==x&&a[i]>a[j]) swap(a[i],a[j]);}}}for(int i=0;i<n;i++) cout << a[i] << " ";cout << endl;return 0;}