結果
問題 |
No.133 カードゲーム
|
ユーザー |
![]() |
提出日時 | 2019-02-11 13:57:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 713 bytes |
コンパイル時間 | 1,412 ms |
コンパイル使用メモリ | 164,196 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 09:13:59 |
合計ジャッジ時間 | 1,994 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 4 |
other | WA * 19 |
ソースコード
#include <bits/stdc++.h> #define int long long #define YES cout<<"YES"<<endl; #define NO cout<<"NO"<<endl; #define Yes cout<<"Yes"<<endl; #define No cout<<"No"<<endl; using namespace std; const int INF=1e9+7; signed main(){ int N;cin>>N; std::vector<int> a(N),b(N); for(int i=0;i<N;i++)cin>>a[i]; for(int i=0;i<N;i++)cin>>b[i]; sort(a.begin(),a.end()); sort(b.begin(),b.end()); double ans=0;double k=0; do{ do{ int A,B;A=B=0;k++; for(int i=0;i<N;i++){ if(a[i]<b[i])B++; if(a[i]>b[i])A++; } cout<<A<<" "<<B<<endl; if(A>B)ans++; }while(next_permutation(a.begin(),a.end())); }while(next_permutation(b.begin(),b.end())); cout<<ans/k<<endl; }