Submission #933819

# Submission time Handle Problem Language Result Execution time Memory
933819 2024-02-26T11:11:39 Z AliHasanli Table Tennis (info1cup20_tabletennis) C++17
0 / 100
41 ms 2900 KB
#include<iostream>
using namespace std;
int main()
{
    int n,k;
    long long cem=0;
    cin>>n>>k;
    long long a[n+k];
    for(int i=0;i<k+n;i++)
    {
        cin>>a[i];
        cem+=a[i];
    }
    bool check=true;
    long long komdeyer=(cem-a[0])/((n+k-1)/2);
    if((cem-a[0])%((n+k-1)/2)==0)
    {
        //cout<<"AA"<<endl;
        for(int i=1;i<n+k;i++)
            if(a[i]+a[n+k-i]!=komdeyer){check=false;break;}
    }
    if(check==true && (cem-a[0])%((n+k-1)/2)==0)
    {
        cout<<a[0];
        return 0;
    }
    check=true;
    komdeyer=(cem-a[n+k-1])/((n+k-1)/2);
    if((cem-a[n+k-1])%((n+k-1)/2)==0)
        for(int i=0;i<n+k-1;i++)
            if(a[i]+a[n+k-i-2]!=komdeyer){check=false;break;}
    if(check && (cem-a[n+k-1])%((n+k-1)/2)==0)
    {
        cout<<a[n+k-1];
        return 0;
    }
    cout<<cem-(a[0]+a[n+k-1])*n/2;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 600 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 2900 KB Expected int32, but "-33999687594167" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected int32, but "30472560394" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected int32, but "-3754111554" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Expected int32, but "3958633012" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected int32, but "4157172747" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Expected int32, but "175408453708" found
2 Halted 0 ms 0 KB -