# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
717415 | 2023-04-01T22:29:41 Z | MrM7md | Table Tennis (info1cup20_tabletennis) | C++17 | 81 ms | 20260 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define F first #define S second #define pb push_back #define all(a) a.begin(),a.end() const int N=1e5; const int off=(1<<20); const int MOD = 1e9+7; signed main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n,k; cin >> n >> k; int sz=n+k; int a[sz]; map<int,bool>mp; for(int i=0;i<sz;i++){ cin >>a[i]; mp[a[i]]=1; } sort(a,a+sz); for(int i=0;i<=k;i++){ for(int j=0;j<=k-i;j++){ int ans=a[i]+a[sz-j-1]; int cur=i+j; for(int w=w;w<=sz-j-1;w++){ if(a[w]!=ans-a[w]){ if(!mp[ans-a[w]]){ if(cur<k&&cur>=0)cur++; else cur=-1; } } else{ if(cur<k&&cur>=0)cur++; else cur=-1; } if(cur==-1)break; } if(cur==k){ for(int w=0;w<sz;w++){ if(mp[ans-a[w]]&&ans-a[w]!=a[w])cout<<a[w]<<' '; } return 0; } // cout<<v.back()<<' '; } } // cout<<v.size()<<endl; } /* */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 468 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 9 ms | 1880 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 75 ms | 20260 KB | Unexpected end of file - int32 expected |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 340 KB | Unexpected end of file - int32 expected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 0 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 468 KB | Unexpected end of file - int32 expected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 212 KB | Output is correct |
2 | Incorrect | 81 ms | 20256 KB | Unexpected end of file - int32 expected |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 340 KB | Output is correct |
2 | Incorrect | 78 ms | 20196 KB | Unexpected end of file - int32 expected |
3 | Halted | 0 ms | 0 KB | - |