Submission #844972

# Submission time Handle Problem Language Result Execution time Memory
844972 2023-09-06T10:17:21 Z samekkk Table Tennis (info1cup20_tabletennis) C++14
0 / 100
3000 ms 3208 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(a,b) for (int a = 0; a < (b); ++a)
#define pb push_back
#define all(t) t.begin(), t.end()

const int max_N = 160005;
int n = 0, k = 0;
int A[max_N];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n >> k;
    rep(i,n+k) cin >> A[i];
    for (int i = 1; i < (1 << (n+k)); ++i)
    {
        vector<int> V;
        rep(j,n+k)
        {
            auto b = (1 << j) & i;
            if (b) V.pb(A[j]);
        }
        if (V.size() != n) continue;
        int S = V[0] + V.back();
        bool czy_OK = true;
        for (int i = 1; i < n/2; ++i) if (V[i] + V[n-i-1] != S) czy_OK = false;
        if (czy_OK == true)
        {
            rep(j,n+k)
            {
                auto b = (1 << j) & i;
                if (b) cout << j+1 << ' ';
            }
            return 0;
        }
    }
    return 0;
}

Compilation message

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:28:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |         if (V.size() != n) continue;
      |             ~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 280 ms 600 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 600 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3005 ms 3208 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 344 KB Output not subsequence of input
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output not subsequence of input
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output not subsequence of input
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 344 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -