Submission #717433

# Submission time Handle Problem Language Result Execution time Memory
717433 2023-04-01T22:53:11 Z vjudge1 Table Tennis (info1cup20_tabletennis) C++17
9 / 100
3000 ms 3040 KB
#include <bits/stdc++.h>
#include <fstream>
#define endl '\n'
#define mod 998244353
#define INF 1000000000000000000
#define ll long long
///#define cin fin
///#define cout fout
#define fi first
#define se second
using namespace std;
///ofstream fout("herding.out");
///ifstream fin("herding.in");


int main()
{
    ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);
    int n, k; cin >> n >> k; vector<long long> v;
    for(int i = 0; i < n+k; i++) {
        int x; cin >> x; v.push_back(x);
    }
    for(int i = 0; i < (1<<(n+k)); i++) {
        vector<long long> vv; int cnt = 0; map<long long,int> mp2;
        for(int j = 0; j < n+k; j++) {
            if((i&(1<<j)) > 0) vv.push_back(v[j]);
            else cnt++;
        }
        if(cnt != k) continue;
        int siz = vv.size(); bool ok = false;
        for(int j = 0; j < (siz/2); j++) {
            mp2[vv[j]+vv[siz-j-1]]++;
            if(mp2[vv[j]+vv[siz-j-1]] == n/2) ok = true;
        }
        if(ok) {
            for(int j = 0; j < siz; j++) {
                cout << vv[j] << ' ';
            }
            return 0;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 378 ms 340 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 3046 ms 3040 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 316 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 340 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 18 ms 2488 KB Unexpected end of file - int32 expected
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -