結果
問題 |
No.133 カードゲーム
|
ユーザー |
|
提出日時 | 2020-07-13 14:23:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 1,700 ms |
コンパイル使用メモリ | 171,132 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 16:21:52 |
合計ジャッジ時間 | 2,665 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main() { int N;scanf("%d",&N); vector<int> order(N); for(int i=0;i<N;i++)order[i]=i; vector<int> A(N),B(N); for(int i=0;i<N;i++)scanf("%d ",&A[i]); for(int i=0;i<N;i++)scanf("%d ",&B[i]); sort(A.begin(),A.end());sort(B.begin(),B.end()); int win=0,total=0; do{ do{ for(int i=0;i<N;i++){total++;if(A[i]>B[i])win++;} }while(next_permutation(B.begin(),B.end())); }while(next_permutation(A.begin(),A.end())); printf("%ld",(double)win/total); }