Submission #717896

# Submission time Handle Problem Language Result Execution time Memory
717896 2023-04-02T20:00:39 Z vjudge1 Table Tennis (info1cup20_tabletennis) C++17
0 / 100
54 ms 1324 KB
#include <bits/stdc++.h>
#define all(v) ((v).begin(),(v).end())
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll mxN = 3e5 + 5;
int a[mxN];
int con[mxN];
map<int,int>fr;
int sum;
signed main(){
  int n,k;
  cin >>n>>k;
  for(int i = 1;i <= n + k;i++){
    cin>>a[i];
    sum += a[i];
  }
  if(k == 1){
    int bg = 2,ed = n + k;
    while(bg < ed){
      con[bg] = ed;
      con[ed] = bg;
      ed--;
      bg++;
      fr[a[ed] + a[bg]]++;
      // cout<<a[ed] + a[bg]<<'\n';
    }
    if(fr[(sum - a[1]) * 2 / (n)] == n / 2){
      for(int i = 2;i <= n + k;i++){
        cout <<a[i]<<' ';
      }
      return 0;
    }
    for(int i = 2;i <= n + k;i++){
      fr[a[i] + a[con[i]]]--;
      con[i - 1] = con[i];
      con[con[i]] = i - 1;
      con[i] = 0;
      fr[a[i - 1] + a[con[i - 1]]]++;
      if(fr[(sum - a[i]) * 2 / (n)] == n / 2){
        for(int j = 1;j <= n + k;j++){
          if(j != i)
          cout <<a[j]<<' ';
        }
        return 0;
      }
    }
    cout<<"TEST";
  }else{

  }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Expected integer, but "TEST" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 1324 KB Expected integer, but "TEST" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 54 ms 784 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -