Submission #690022

#TimeUsernameProblemLanguageResultExecution timeMemory
690022AiperiiiTable Tennis (info1cup20_tabletennis)C++14
0 / 100
58 ms2252 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; vector <int> a(n+m); for(int i=0;i<n+m;i++){ cin>>a[i]; } sort(a.begin(),a.end()); int x=a[1]-a[0]; vector <int> vec; vec.push_back(0); for(int i=0;i<a.size()-1;i++){ if(a[i+1]-a[i]!=x){ x=(a[i+1]-a[i]); vec.push_back(i+1); } } vec.push_back(n+m); for(int i=0;i<vec.size();i++){ if(vec[i+1]-vec[i]==n){ for(int j=vec[i];j<vec[i+1];j++){ cout<<a[j]<<" "; } return 0; } } }

Compilation message (stderr)

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:14:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for(int i=0;i<a.size()-1;i++){
      |                 ~^~~~~~~~~~~
tabletennis.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=0;i<vec.size();i++){
      |                 ~^~~~~~~~~~~
#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...