Submission #491492

#TimeUsernameProblemLanguageResultExecution timeMemory
491492Ghost_in_the_WireBest Place (NOI17_bestplace)C++17
0 / 100
82 ms2044 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<long long> vi;

int main() {
    ll n;
    cin >> n;
    vi posx = {};
    vi posy = {};
    for (int i = 0; i < n; i++) {
        ll temp1, temp2;
        cin >> temp1 >> temp2;
        posx.push_back(temp1);
        posy.push_back(temp2);
    }
    ll sumx, sumy = 0;
    for (auto x: posx) sumx = sumx + x;
    for (auto y: posy) sumy = sumy + y;
    cout << round(sumx / n) << " " << round(sumy / n) << "\n";
}

Compilation message (stderr)

bestplace.cpp: In function 'int main()':
bestplace.cpp:22:27: warning: 'sumx' may be used uninitialized in this function [-Wmaybe-uninitialized]
   22 |     cout << round(sumx / n) << " " << round(sumy / n) << "\n";
      |                           ^
#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...