Submission #491577

# Submission time Handle Problem Language Result Execution time Memory
491577 2021-12-03T11:01:03 Z n3rm1n Table Tennis (info1cup20_tabletennis) C++17
0 / 100
16 ms 2860 KB
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int MAXN=150005;
void speed()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}
int n,k;
long long a[MAXN];
void read()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
        cin>>a[i];
}
bool check(int idx)
{
    int i=1,j=n;
    if(i==idx)i++;
    if(j==idx)j--;
    long long sum=a[i]+a[j];
    i++;
    j--;
    while(i<j)
    {
       if(i==idx)i++;
       if(j==idx)j--;
       if(a[i]+a[j]!=sum)return false;
       i++;
       j--;
    }
    return true;
}
void solve_st1()
{
    for(int i=1;i<=n;i++)
    {
        if(check(i)==true)
        {
            for(int j=1;j<i;j++)
                cout<<a[j]<<" ";
            for(int j=i+1;j<=n;j++)
                cout<<a[j]<<" ";
            cout<<endl;
        }
    }
}
int main()
{
	speed();
	read();
	if(k==1&&n<=2000)
    {
        solve_st1();
    }
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 588 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 2860 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -