답안 #717897

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
717897 2023-04-02T20:01:20 Z vjudge1 Table Tennis (info1cup20_tabletennis) C++17
11 / 100
56 ms 1876 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;
ll a[mxN];
ll con[mxN];
map<ll,ll>fr;
ll sum;
signed main(){
  ll n,k;
  cin >>n>>k;
  for(ll i = 1;i <= n + k;i++){
    cin>>a[i];
    sum += a[i];
  }
  if(k == 1){
    ll 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(ll i = 2;i <= n + k;i++){
        cout <<a[i]<<' ';
      }
      return 0;
    }
    for(ll 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(ll j = 1;j <= n + k;j++){
          if(j != i)
          cout <<a[j]<<' ';
        }
        return 0;
      }
    }
    cout<<"TEST";
  }else{

  }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Correct 2 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 15 ms 1876 KB Expected integer, but "TEST" found
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 56 ms 1376 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -