Submission #798453

#TimeUsernameProblemLanguageResultExecution timeMemory
798453XJP12Best Place (NOI17_bestplace)C++14
0 / 100
54 ms1432 KiB
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<vi> vii; int main(){ int n; cin>>n; vector<pair<int,int>> v; int cont; for(int i=0; i<n; i++){ int a,b; cin>>a>>b; if(i==0 || i==n-1){ cont+=a; } v.push_back({a,b}); } cout<<cont/2<<" "<<v[0].second<<endl; }

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:19:16: warning: 'cont' may be used uninitialized in this function [-Wmaybe-uninitialized]
   19 |  cout<<cont/2<<" "<<v[0].second<<endl;
      |                ^~~
#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...