結果
| 問題 |
No.490 yukiソート
|
| コンテスト | |
| ユーザー |
newlife171128
|
| 提出日時 | 2018-01-06 21:48:43 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 565 bytes |
| コンパイル時間 | 509 ms |
| コンパイル使用メモリ | 74,712 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-23 08:54:41 |
| 合計ジャッジ時間 | 1,713 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 19 |
ソースコード
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
#include <stack>
#include <cctype>
#include <stdio.h>
using namespace std;
int main() {
int n = 0;
cin >> n;
long a[n];
long tmp=0;
for(int i=0; i<n;i++){
cin>>tmp;
a[i] =tmp;
}
for(int i=1; i<2*n-3; i++){
for(int p=0; p<n-1; p++){
int q = i-p;
if(p>q && q >=0 /*&& p<=n-1*/){
if(a[q]>a[p]){
swap(a[q],a[p]);
}
}
}
}
for(int i=0; i<n;i++){
cout<<a[i]<<" ";
}
cout<<endl;
return 0;
}
newlife171128