#include #include #include constexpr int battleNum = 100000; int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); std::random_device rnd; std::mt19937 mt(rnd()); int n; std::cin >> n; std::vector a(n), b(n); for(auto& it : a){ std::cin >> it; } for(auto& it : b){ std::cin >> it; } int cnt=0; for(int i=0; i tmpA(a), tmpB(b); for(int j=n; j>=1; --j){ int tmpAN = mt()%j; int tmpBN = mt()%j; if(tmpA[tmpAN]>tmpB[tmpBN]) ++winCnt; if(tmpA[tmpAN]0) ++cnt; } std::cout << 1.0*cnt/battleNum << "\n"; return 0; }