Submission #691281

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

Compilation message (stderr)

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:15:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |             for(int j=0;j<ans.size()-1;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...