結果
| 問題 | No.490 yukiソート |
| コンテスト | |
| ユーザー |
kanTiramisu
|
| 提出日時 | 2019-05-11 12:57:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 606 bytes |
| コンパイル時間 | 1,252 ms |
| コンパイル使用メモリ | 157,276 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 01:09:38 |
| 合計ジャッジ時間 | 5,904 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 14 RE * 20 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
int n;
int temp;
int a[100];
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> a[i];
}
for(int i = 1; i < 2*n-3; i++)
{
for(int p = 0; p < n-1; p++)
{
if (i-p > p){
if(a[i-p] < a[p]){
temp = a[i-p];
a[i-p] = a[p];
a[p] = temp;
/*swap(a[i-p],a[p])*/
}
}
}
}
for(int i = 0; i < n; i++)
{
cout << a[i];
}
}
kanTiramisu