結果
| 問題 |
No.397 NO MORE KADOMATSU
|
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-07-15 23:12:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 474 bytes |
| コンパイル時間 | 576 ms |
| コンパイル使用メモリ | 63,568 KB |
| 実行使用メモリ | 25,604 KB |
| 平均クエリ数 | 935.83 |
| 最終ジャッジ日時 | 2024-07-16 10:36:38 |
| 合計ジャッジ時間 | 4,806 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 18 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
void bubblesort(vector<int> &a) {
bool flag = 1;
for (int i = 0; flag; i++) {
flag = 0;
for (int j = n - 1; j >= i + 1; j--) {
if (a[j] < a[j - 1]) {
cout << j << " " << j - 1 << endl;
swap(a[j], a[j - 1]);
flag = 1;
}
}
}
}
int main() {
vector<int> a;
cin >> n;
a.resize(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
bubblesort(a);
return 0;
}
kurenai3110