제출 #310591

#제출 시각아이디문제언어결과실행 시간메모리
310591juggernaut말 (IOI15_horses)C++14
0 / 100
16 ms8448 KiB
#include"horses.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; ll x[1005],y[1005],n,mod=1e9+7; ll solve(){ ll res=0,i,cnt=1; double lg=0,ans=0; for(i=0;i<n;i++){ cnt=(cnt*x[i])%mod; lg+=log(x[i]); if(lg+log2(y[i])>res){ ans=lg+log(y[i]); res=(cnt*y[i])%mod; } } return res; } int init(int N,int X[],int Y[]){ n=N; copy(X,X+n,x); copy(Y,Y+n,y); return solve(); } int updateX(int pos,int val){ x[pos]=val; return solve(); } int updateY(int pos,int val){ y[pos]=val; return solve(); }

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

horses.cpp: In function 'll solve()':
horses.cpp:12:26: warning: conversion from 'll' {aka 'long long int'} to 'double' may change value [-Wconversion]
   12 |         if(lg+log2(y[i])>res){
      |                          ^~~
horses.cpp:8:17: warning: variable 'ans' set but not used [-Wunused-but-set-variable]
    8 |     double lg=0,ans=0;
      |                 ^~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:23:14: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   23 |  return solve();
      |         ~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:27:14: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   27 |  return solve();
      |         ~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:31:14: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   31 |  return solve();
      |         ~~~~~^~
#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...