Submission #887491

# Submission time Handle Problem Language Result Execution time Memory
887491 2023-12-14T16:05:10 Z islam998 Table Tennis (info1cup20_tabletennis) C++17
0 / 100
45 ms 11284 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define endl "\n"
#define nots0fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define vl vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define in insert
#define size(y) (int)y.size()
#define all(v) v.begin(), v.end()
#define allr(v)  v.rbegin(),v.rend()
#define INF 1e9+31
#define MAX 151000
#define MOD 1000000007
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

vl v(MAX),pre(MAX);

void solve(){
    ll n, k, l, r, sum = 0, dnt = 0;
    cin >> n >> k;
    multiset<ll>ms;
    for(int i = 1; i <= n + k; i++){
        cin >> v[i];
        sum += v[i];
    }
    for(int i = 1; i <= n + k; i++){
        sum-=v[i];
        if(sum % (n / 2) == 0){
            dnt = i;
            break;
        }
        sum += v[i];
    }
    for(int i = 1; i <= n + k; i++){
        if(i != dnt){
            ms.in(v[i]);
        }
    }
    for(auto &i : ms){
        cout << i << " ";
    }
}

int main(){
    nots0fast
    ll test = 1;
    ///cin >> test;
    for(int tst = 0; tst < test; tst++){
        solve();
        cout << "\n";
    }
    return 0;
}
/**

**/

Compilation message

tabletennis.cpp: In function 'void solve()':
tabletennis.cpp:27:14: warning: unused variable 'l' [-Wunused-variable]
   27 |     ll n, k, l, r, sum = 0, dnt = 0;
      |              ^
tabletennis.cpp:27:17: warning: unused variable 'r' [-Wunused-variable]
   27 |     ll n, k, l, r, sum = 0, dnt = 0;
      |                 ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2904 KB Output is correct
2 Incorrect 2 ms 2908 KB Output does not have symmetry property
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 7 ms 3932 KB Output is correct
2 Correct 44 ms 11284 KB Output is correct
3 Incorrect 44 ms 11088 KB Output does not have symmetry property
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 11092 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2648 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2652 KB Output does not have symmetry property
2 Halted 0 ms 0 KB -