답안 #718175

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
718175 2023-04-03T14:26:17 Z vjudge1 Table Tennis (info1cup20_tabletennis) C++17
0 / 100
3000 ms 391228 KB
#include "bits/stdc++.h"
#define ll long long
#define pb push_back
#define endl '\n'
#define fi first
#define sec second
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

    ll n,k;
    cin>>n>>k;
    map<ll,vector<ll>>mp;
    ll arr[n+k];
    ll cnt=0;
    for(int i=0;i<n+k;i++)
    {
      cin>>arr[i];
      if(i)
        for(int j=0;j<i;j++)
        {
          mp[arr[i]+arr[j]].pb(arr[i]);
          mp[arr[i]+arr[j]].pb(arr[j]);
          if(mp[arr[i]+arr[j]].size()>cnt)cnt=arr[i]+arr[j];
        }
    }
    vector<ll>ans;
    for(auto u:mp[cnt])ans.pb(u);
    sort(ans.begin(),ans.end());
    for(auto u:ans)cout<<u<<' ';
    return 0;
}
/*

*/

Compilation message

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:28:38: warning: comparison of integer expressions of different signedness: 'std::vector<long long int>::size_type' {aka 'long unsigned int'} and 'long long int' [-Wsign-compare]
   28 |           if(mp[arr[i]+arr[j]].size()>cnt)cnt=arr[i]+arr[j];
      |              ~~~~~~~~~~~~~~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1060 ms 132972 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3083 ms 316840 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 3068 ms 391228 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 1236 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 1 ms 340 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 50 ms 10316 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -