Borderou de evaluare (job #2596332)

Utilizator alex_benescubenescu alexandru alex_benescu Data 9 aprilie 2020 16:50:11
Problema Curse de cai Status done
Runda Arhiva de probleme Compilator cpp-64 | Vezi sursa
Scor 100

Raport evaluator

Compilare: main.cpp:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated] #import<algorithm> ^~~~~~ main.cpp:2:2: warning: #import is a deprecated GCC extension [-Wdeprecated] #import<fstream> ^~~~~~ main.cpp:3:58: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] using namespace std;int n,a[2000],b[2000],s,i,j,k,t;main(){ifstream cin("cai.in");ofstream cout("cai.out");cin>>t;while(t--){cin>>n;for(i=0;i<n;i++)cin>>a[i];for(i=0;i<n;i++)cin>>b[i];sort(a,a+n);sort(b,b+n);s=-200*n;for(j=0;j<n;j++){k=0;for(i=0;i<n;i++){if(a[i]>b[(i+j)%n])k+=200;if(a[i]<b[(i+j)%n])k-=200;}if(k>s)s=k;}cout<<s<<endl;}} ^
Test Timp executie Memorie folosita Mesaj Punctaj/test
1180ms131kbOK100
Punctaj total100

Ceva nu functioneaza?