제출 #466126

#제출 시각아이디문제언어결과실행 시간메모리
466126NanoginesBest Place (NOI17_bestplace)C++14
0 / 100
1092 ms420 KiB
#include <bits/stdc++.h>
using namespace std;

#define int long long int
#define fastio ios::sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define forn(i, a, b) for (int i=a; i<b; i++)
#define fore(i, a, b) for (int i=a; i<=b; i++)
typedef vector<int> vi;

void fast_io() {
  fastio;
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}


signed main()
{
  fast_io();
  int n;
  cin >> n;
  int c, d;
  int s1 = 0, s2 = 0;
  forn(i, 0, n) {
    cin >> c >> d;
    s1 += c;
    s2 += d;
  }
  cout << ceil(s1 / n) << " " << ceil(s2 / n) << endl;
}

컴파일 시 표준 에러 (stderr) 메시지

bestplace.cpp: In function 'void fast_io()':
bestplace.cpp:13:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   freopen("input.txt", "r", stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
bestplace.cpp:14:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |   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...