結果
問題 | No.133 カードゲーム |
ユーザー |
|
提出日時 | 2024-12-13 17:55:30 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 514 bytes |
コンパイル時間 | 2,333 ms |
コンパイル使用メモリ | 113,944 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-13 17:55:34 |
合計ジャッジ時間 | 3,819 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 19 |
ソースコード
#include <iostream>#include <string>#include <vector>#include <algorithm>#include <map>#include <queue>#include <iomanip>#include <climits>using namespace std;int main() {int n, a[4], b[4], x[] {0, 1, 2, 3}, v {}, s {};cin >> n;for (int i = 0; i < n; ++i) cin >> a[i];for (int i = 0; i < n; ++i) cin >> b[i];do {int vs {};for (int i = 0; i < n; ++i) {if (b[x[i]] < a[i]) ++vs;}if (n < vs * 2) ++v;++s;} while (next_permutation(x, x + n));cout << (double)v / s << '\n';}