結果
| 問題 |
No.133 カードゲーム
|
| コンテスト | |
| ユーザー |
nemakura3
|
| 提出日時 | 2019-09-11 21:33:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 830 bytes |
| コンパイル時間 | 1,626 ms |
| コンパイル使用メモリ | 169,552 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 16:52:47 |
| 合計ジャッジ時間 | 2,621 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 WA * 1 |
| other | AC * 6 WA * 13 |
ソースコード
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int (i) = (a); (i) < (b); ++(i))
#define rep(i,n) for (int (i) = 0; (i) < (n); ++(i))
#define rrep(i,n) for (int (i) = (n); (i) >= 0; --(i))
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int INF = 1e9;
const ll LINF = 1LL << 60;
const ll MOD = 1e9 + 7;
int N, A[4], B[4];
int main() {
cin >> N;
rep(i,N) cin >> A[i];
rep(i,N) cin >> B[i];
sort(A, A+N);
sort(B, B+N);
int awin = 0;
int ap = 0;
do {
do {
++ap;
rep(i,N) {
if (A[i] > B[i]) ++awin;
}
} while (next_permutation(B, B+N));
} while (next_permutation(A, A+N));
double p = (double)awin / (double)ap - 1.0;
cout << fixed << setprecision(10) << p << "\n";
return 0;
}
nemakura3