제출 #869911

#제출 시각아이디문제언어결과실행 시간메모리
869911qinHorses (IOI15_horses)C++17
17 / 100
30 ms14172 KiB
#ifdef LOCAL #else #include "horses.h" #endif #include <bits/stdc++.h> #define fi first #define se second #define ssize(x) int(x.size()) #define pn printf("\n") using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef double db; int inf = 2e09; ll infll = 2e18; ll mod = 1e09+7; int updateX(int i, int val){ return 0; } int updateY(int i, int val){ return 0; } int init(int n, int x[], int y[]){ vector<ll> X(n), Y(n); for(int i = 0; i < n; ++i) X[i] = x[i], Y[i] = y[i]; int opt = 0; ll mul = 1; bool overflow = 0; db tmp; for(int i = 1; i < n; ++i){ mul *= X[i]; if(mul >= mod) overflow = 1, mul %= mod; if(overflow) opt = i, mul = 1, overflow = 0; else{ tmp = db(Y[opt])/db(Y[i]); if(db(mul) >= tmp) opt = i, mul = 1, overflow = 0; } } ll result = Y[opt]; for(int i = 0; i <= opt; ++i) result = result * X[i] % mod; return int(result); } #ifdef LOCAL int main(){ int T = 1; for(++T; --T; ){ int n = 3, x[3] = {2, 1, 3}, y[3] = {3, 2, 1}; printf("%d\n", init(n, x, y)); } return 0; } #endif

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

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:16:17: warning: unused parameter 'i' [-Wunused-parameter]
   16 | int updateX(int i, int val){ return 0; }
      |             ~~~~^
horses.cpp:16:24: warning: unused parameter 'val' [-Wunused-parameter]
   16 | int updateX(int i, int val){ return 0; }
      |                    ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:17:17: warning: unused parameter 'i' [-Wunused-parameter]
   17 | int updateY(int i, int val){ return 0; }
      |             ~~~~^
horses.cpp:17:24: warning: unused parameter 'val' [-Wunused-parameter]
   17 | int updateY(int i, int val){ return 0; }
      |                    ~~~~^~~
#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...