제출 #831047

#제출 시각아이디문제언어결과실행 시간메모리
831047skittles1412말 (IOI15_horses)C++17
17 / 100
24 ms14164 KiB
#include "bits/extc++.h" using namespace std; template <typename T, typename... U> void dbgh(const T& t, const U&... u) { cerr << t; ((cerr << " | " << u), ...); cerr << endl; } #ifdef DEBUG #define dbg(...) \ cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]: "; \ dbgh(__VA_ARGS__) #else #define dbg(...) #define cerr \ if (false) \ cerr #endif #define endl "\n" #define long int64_t #define sz(x) int(std::size(x)) struct Solver { vector<int> arr_x, arr_y; Solver() {} Solver(const vector<int>& arr_x, const vector<int>& arr_y) : arr_x(arr_x), arr_y(arr_y) {} int query() { int n = sz(arr_x); int ans = 0; for (int i = 0, mul = 1; i < n; i++) { mul *= arr_x[i]; ans = max(ans, mul * arr_y[i]); } return ans; } } solver; int init(int n, int arr_x[], int arr_y[]) { solver = Solver(vector<int>(arr_x, arr_x + n), vector<int>(arr_y, arr_y + n)); return solver.query(); } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

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

horses.cpp: In constructor 'Solver::Solver(const std::vector<int>&, const std::vector<int>&)':
horses.cpp:30:57: warning: declaration of 'arr_y' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |                                      ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:24: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                        ^~~~~
horses.cpp:30:31: warning: declaration of 'arr_x' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |            ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:17: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                 ^~~~~
horses.cpp: In constructor 'Solver::Solver(const std::vector<int>&, const std::vector<int>&)':
horses.cpp:30:57: warning: declaration of 'arr_y' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |                                      ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:24: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                        ^~~~~
horses.cpp:30:31: warning: declaration of 'arr_x' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |            ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:17: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                 ^~~~~
horses.cpp: In constructor 'Solver::Solver(const std::vector<int>&, const std::vector<int>&)':
horses.cpp:30:57: warning: declaration of 'arr_y' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |                                      ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:24: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                        ^~~~~
horses.cpp:30:31: warning: declaration of 'arr_x' shadows a member of 'Solver' [-Wshadow]
   30 |     Solver(const vector<int>& arr_x, const vector<int>& arr_y)
      |            ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:28:17: note: shadowed declaration is here
   28 |     vector<int> arr_x, arr_y;
      |                 ^~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:53:17: warning: unused parameter 'pos' [-Wunused-parameter]
   53 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:53:26: warning: unused parameter 'val' [-Wunused-parameter]
   53 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:56:17: warning: unused parameter 'pos' [-Wunused-parameter]
   56 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:56:26: warning: unused parameter 'val' [-Wunused-parameter]
   56 | int updateY(int pos, int val) {
      |                      ~~~~^~~
#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...