結果
| 問題 | No.3489 あみだくじ作り |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-03 22:24:58 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 2,195 ms |
| コンパイル使用メモリ | 333,488 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-04-03 22:25:14 |
| 合計ジャッジ時間 | 5,232 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge5_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<int> a(n), ans;
for(auto &&v : a) cin >> v;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(a[i] > a[j]){
swap(a[i], a[j]);
ans.emplace_back(i + 1);
}
}
}
reverse(ans.begin(), ans.end());
cout << ans.size() << '\n';
for(auto &&v : ans) cout << v << '\n';
}