# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
365809 | 2021-02-12T12:11:18 Z | fadi57 | Table Tennis (info1cup20_tabletennis) | C++17 | 103 ms | 17132 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mx=100005; const int mod= 1e9+7 ; const ll inf=1e12+4; //***while there is life there is hope int n,k; int main() { //ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); cin>>n>>k; int nteams=n/2; map<int,int>mp;ll sum=0; ll a[n]; for(int i=0;i<n+k;i++){ cin>>a[i];sum+=a[i]; mp[a[i]]++; } int ans=0; int can=-1; for(int i=0;i<n+k;i++){ int sum2=sum-a[i]; mp[a[i]]=0; int target=sum2/nteams;int ok=1; if(sum2%nteams!=0){continue;}else{ int f=0;int en=n+k-1; for(int j=0;j<nteams;j++){ if(f==i){f++;} if(en==i){en--;} if(a[f]+a[en]!=target){ok=0;break;} } if(ok){can=i;}break;; } } for(int i=0;i<n+k;i++){ if(i!=can){cout<<a[i]<<" ";} } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 492 KB | Output does not have symmetry property |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 17 ms | 1664 KB | Output does not have symmetry property |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 103 ms | 17132 KB | Execution killed with signal 8 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 620 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 492 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |