結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-02-19 21:42:29 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| コンパイル時間 | 1,608 ms |
| コンパイル使用メモリ | 68,992 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 18:18:22 |
| 合計ジャッジ時間 | 1,889 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | AC * 3 WA * 31 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;cin>>n;
vector<int> A(n);
for(int i = 0; n > i; i++){
cin>>A[i];
}
for(int i = 1; 2*n-3 > i; i++){
for(int j = 0;n-1 >= j; j++){
int p = j;
int q = i-j;
if(p >= q)break;
if(q >= n-1)continue;
if(A[p] < A[q]){
swap(A[p],A[q]);
}
}
}
for(int i = 0; n > i; i++){
cout << A[i];
if(i+1 != n)cout << " ";
}
cout << endl;
}