結果
| 問題 | No.133 カードゲーム |
| コンテスト | |
| ユーザー |
Okuda_desu
|
| 提出日時 | 2018-04-22 00:21:53 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 474 bytes |
| 記録 | |
| コンパイル時間 | 1,233 ms |
| コンパイル使用メモリ | 184,128 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-14 13:01:35 |
| 合計ジャッジ時間 | 1,930 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int A[4],B[4];
cin >> N;
for (int i = 0; i < N; i++) cin >> A[i];
for (int i = 0; i < N; i++) cin >> B[i];
sort(A, A + N);
sort(B, B + N);
int p = 0;
int n = 0;
do {
do {
p++;
int m = 0;
for (int i = 0; i < N; i++) {
if (A[i] > B[i]) m++;
}
if (m > N - m) n++;
} while (next_permutation(B, B + N));
} while (next_permutation(A, A + N));
cout << (double) n / p << endl;
}
Okuda_desu