Submission #486610

#TimeUsernameProblemLanguageResultExecution timeMemory
486610OverloadedBest Place (NOI17_bestplace)C++17
3 / 100
71 ms1400 KiB
#include<bits/stdc++.h> using namespace std; typedef long long int ll; typedef float ff; typedef vector<long long int> vi; #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define sz(x) (int)x.size() #define pb(x) push_back(x) #define endl "\n" int txtinput(){ #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif return 0; } int solve(){ ll a,b,x = 0,y = 0,n; cin>>n; for(long long int i = 0; i<n; i++){ cin>>a>>b; x+=a;y+=b; } cout<<x/n<<" "<<y/n; return 0; } int main(){ //txtinput(); //ll t; //cin>>t; //while(t--){ solve(); //} return 0; }

Compilation message (stderr)

bestplace.cpp: In function 'int txtinput()':
bestplace.cpp:14:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     freopen("input.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
bestplace.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     freopen("output.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...