# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
227802 | 2020-04-28T23:23:23 Z | blacktulip | Table Tennis (info1cup20_tabletennis) | C++17 | 3000 ms | 504696 KB |
#include <bits/stdc++.h> using namespace std; typedef long long lo; typedef pair< lo,lo > PII; #define fi first #define se second #define mp make_pair #define pb push_back #define int long long #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo MAX = -1000000000000000000; const lo MIN = 1000000000000000000; const lo inf = 1000000000; const lo KOK = 100000; const lo LOG = 30; const lo li = 500005; const lo mod = 1000000007; int n,m,b[li],a[li],k,flag,t,sum,mx; int cev; string s; map<int,int> mpp; vector<int> v; main(void){ scanf("%lld %lld",&n,&k); for(int i=1;i<=n+k;i++)scanf("%lld",&a[i]); for(int i=1;i<=2*k+1000;i++){ for(int j=i+1;j<=n+k;j++){ mpp[a[i]+a[j]]++; if(mpp[a[i]+a[j]]>mx){sum=a[i]+a[j];mx=mpp[a[i]+a[j]];} } } int bas=1; int son=n+k; flag=0; cev=0; //~ v.clear(); //~ printf("%d\n",v.size()); while(bas<son){ if(a[bas]+a[son]==sum){v.pb(a[bas]);v.pb(a[son]);bas++;son--;cev++;} else if(a[bas]+a[son]<sum){bas++;} else if(a[bas]+a[son]>sum){son--;} if(cev>=n/2){flag=1;break;} } if(flag==1){ sort(v.begin(),v.end()); for(int i=0;i<(int)v.size();i++){ printf("%lld ",v[i]); } return 0; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 549 ms | 48712 KB | Output is correct |
2 | Correct | 146 ms | 760 KB | Output is correct |
3 | Correct | 687 ms | 66936 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3078 ms | 2200 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3112 ms | 471988 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 896 KB | Output is correct |
2 | Correct | 9 ms | 1152 KB | Output is correct |
3 | Correct | 8 ms | 1280 KB | Output is correct |
4 | Correct | 9 ms | 1280 KB | Output is correct |
5 | Correct | 9 ms | 1280 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 304 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 201 ms | 2784 KB | Output is correct |
3 | Correct | 1213 ms | 89336 KB | Output is correct |
4 | Correct | 812 ms | 70136 KB | Output is correct |
5 | Correct | 166 ms | 2040 KB | Output is correct |
6 | Correct | 193 ms | 1200 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Execution timed out | 3104 ms | 353016 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 35 ms | 6016 KB | Output is correct |
2 | Execution timed out | 3117 ms | 504696 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |