Submission #499564

# Submission time Handle Problem Language Result Execution time Memory
499564 2021-12-28T16:15:31 Z bigo Table Tennis (info1cup20_tabletennis) C++14
0 / 100
134 ms 7804 KB
#include <iostream>
#include <cmath>
#include <math.h>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#define M 1000000007
#define pii pair<int, int>
typedef long long ll;
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    multiset<int>set1;
    vector<int>vec(n+k);
    ll sum = 0;
    for (int i = 0; i < n + k; i++) {
        cin >> vec[i];
        set1.insert(vec[i]);
        sum += vec[i];
    }
    for (int i = 0; i < n + k; i++) {
        ll sum1 = sum - vec[i];
        set1.erase(set1.find(vec[i]));
        auto it = set1.begin();
        int a1 = *it;
        ++it;
        int a2 = *it;
        int d = a2 - a1;
        ll sum2 = (2 * a1 + (n - 1) * d) * n / 2;
        if (sum2 == sum1) {
            int cnt = 0;
            for (int j = 0; j < n + k; j++) {
                if (j != i) {
                    cnt++;
                    cout << vec[j];
                    if (cnt != n)
                        cout << " ";
                }
            }
            break;
        }
        set1.insert(vec[i]);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 332 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 1228 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 134 ms 7804 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 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 -