結果
| 問題 |
No.397 NO MORE KADOMATSU
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-15 01:09:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 2,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 452 ms |
| コンパイル使用メモリ | 55,772 KB |
| 実行使用メモリ | 25,220 KB |
| 平均クエリ数 | 414.83 |
| 最終ジャッジ日時 | 2024-07-17 00:36:59 |
| 合計ジャッジ時間 | 1,927 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
#include "iostream"
using namespace std;
int N;
int num[100];
int box;
int ans;
int first[10000];
int second[10000];
int main() {
cin >> N;
for (int i = 0; i < N; i++) {
cin >> num[i];
}
for (int i = 0; i < N-1; i++) {
for (int j = i+1; j < N; j++) {
if (num[i] < num[j]) {
box = num[i];
num[i] = num[j];
num[j] = box;
first[ans] = i;
second[ans] = j;
ans++;
}
}
}
cout << ans << "\n";
for (int i = 0; i < ans; i++) {
cout << first[i] << " " << second[i] << "\n";
}
cout << endl;
cin >> ans;
return 0;
}