# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
227801 | 2020-04-28T23:21:50 Z | blacktulip | Table Tennis (info1cup20_tabletennis) | C++17 | 3000 ms | 511112 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<=n+k;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 | 793 ms | 65144 KB | Output is correct |
2 | Correct | 196 ms | 1016 KB | Output is correct |
3 | Correct | 929 ms | 88692 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3087 ms | 2040 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3106 ms | 471436 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 896 KB | Output is correct |
2 | Correct | 8 ms | 1280 KB | Output is correct |
3 | Correct | 8 ms | 1280 KB | Output is correct |
4 | Correct | 10 ms | 1280 KB | Output is correct |
5 | Correct | 11 ms | 1280 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 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 | 250 ms | 3320 KB | Output is correct |
3 | Correct | 1563 ms | 117140 KB | Output is correct |
4 | Correct | 992 ms | 91308 KB | Output is correct |
5 | Correct | 216 ms | 3320 KB | Output is correct |
6 | Correct | 227 ms | 1400 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Execution timed out | 3096 ms | 355704 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 44 ms | 6008 KB | Output is correct |
2 | Execution timed out | 3112 ms | 511112 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |