제출 #800799

#제출 시각아이디문제언어결과실행 시간메모리
800799Liudas말 (IOI15_horses)C++17
34 / 100
1591 ms15944 KiB
#include <bits/stdc++.h> #include "horses.h" using namespace std; vector<long long> X, Y; int N; int calc(){ double a = 0, t = 0; int id = 0; for(int i = 0; i < N; i ++){ t += log(X[i]); if(t + log(Y[i]) > a){ a = t + log(Y[i]); id = i; } } long long ans = 1, MOD = 1e9 + 7; ans *= Y[id]; for(int i = 0; i <= id; i ++){ ans = ans * X[i] % MOD; } return ans; } int init(int NN, int XX[], int YY[]){ N = NN; X.resize(N); Y.resize(N); for(int i = 0; i < N; i ++){ X[i] = XX[i]; Y[i] = YY[i]; } return calc(); } int updateX(int pos, int val){ X[pos] = val; return calc(); } int updateY(int pos, int val){ Y[pos] = val; return calc(); }

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

horses.cpp: In function 'int calc()':
horses.cpp:21:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   21 |     return ans;
      |            ^~~
#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...