Submission #751766

# Submission time Handle Problem Language Result Execution time Memory
751766 2023-06-01T11:58:21 Z AtabayRajabli Table Tennis (info1cup20_tabletennis) C++11
0 / 100
29 ms 4300 KB
#include <bits/stdc++.h>
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define MAX 5e4 + 1
#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define OPT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define sec second
#define fi first
#define elif else if
#define print(k) cerr << "Ans : "; cout << k << endl;
#define int ll
#define ask(a, b) cout << "? " << a << " " << b << endl;
#define ins insert

typedef long long ll;
typedef unsigned long long ull;
const int oo = INT_MAX;
const int ooo = 0x3F3F3F3F3F3F3F3FLL;
const int mod = 301907;
using namespace std;

void solve()
{
    int n, k;
    cin >> n >> k;

    vector<int> v(n+k);

    for(int i = 0; i<n+k; i++)
    {
        cin >> v[i];
    }

    for(int i = 0; i<n+k; i++)
    {
        int l = 0, r = n+k-1;
        int sum = 0, c = 0;
        while(l<r)
        {
            if(l == i)l++;
            if(r == i)r--;

            if(sum == 0)sum == v[l] + v[r];
            else if(sum != v[l]+v[r])
            {
                c = 1;
                break;
            }
            r--;
            l++;
        }
        if(!c)
        {
            for(int j = 0; j<n+k; j++)
                if(j!=i)cout << v[j] << " ";
            return;
        }
    }

}

int32_t main()
{
    OPT

    int t = 1;
    //cin >> t;
    while(t--)
        solve();
}
 

Compilation message

tabletennis.cpp: In function 'void solve()':
tabletennis.cpp:45:29: warning: value computed is not used [-Wunused-value]
   45 |             if(sum == 0)sum == v[l] + v[r];
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output does not have symmetry property
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 852 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 29 ms 4300 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 324 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -