Submission #690839

#TimeUsernameProblemLanguageResultExecution timeMemory
690839AiperiiiTable Tennis (info1cup20_tabletennis)C++14
0 / 100
3061 ms2168 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; n+=k; vector <int> a(n),vec; for(int i=0;i<n;i++){ cin>>a[i]; vec.push_back(a[i]); } sort(vec.begin(),vec.end()); for(int i=0;i<a.size();i++){ map <int,int> mp; vec.erase(vec.begin()+i); for(int j=0;j<vec.size()-1;j++){ mp[vec[j+1]-vec[j]]++; } if(mp.size()==1){ break; } vec.insert(vec.begin()+i,a[i]); } for(int j=0;j<vec.size();j++){ cout<<vec[j]<<" "; } }

Compilation message (stderr)

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<a.size();i++){
      |                 ~^~~~~~~~~
tabletennis.cpp:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int j=0;j<vec.size()-1;j++){
      |                     ~^~~~~~~~~~~~~
tabletennis.cpp:24:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int j=0;j<vec.size();j++){
      |                 ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...