ugh

frank0706 2024-01-24 11:29:37

#include #include using namespace std; int a[1000000],b[1000000]; bool tmp(int x,int y){ return x>y; } int main() { int n,s1=0,s2=0,min=999999,min1=99999999,f=0; cin >> n; for(int i=1;i<=n;i++){ cin >> a[i]; if(a[i]<min){ min=a[i]; f=i; } } for(int i=1;i<=n;i++){ cin >> b[i]; } swap(a[f],a[1]); sort(a+2,a+n+1,tmp); sort(b+1,b+n+1,tmp); for(int i=1;i<=n;i++){ if(a[i]>b[i]){ s1++; } if(a[i]<b[i]){ s2++; } } cout << s1 << " " << ":" << " " << s2; return 0; }