Submission #387661

#TimeUsernameProblemLanguageResultExecution timeMemory
387661Pichon5Horses (IOI15_horses)C++17
17 / 100
14 ms8296 KiB
#include "horses.h" #define vi vector<int> #define ll long long int #include <bits/stdc++.h> using namespace std; const ll mod=1e9+7; const ll tam =1005; ll x[tam]; ll y[tam]; ll n; ll solve(){ ll num=1; ll res=0; for(int i=0;i<n;i++){ num*=x[i]%mod; res=max(res,y[i]*num); } return res%mod; } int init(int N, int X[], int Y[]) { n=N; for(int i=0;i<n;i++){ x[i]=X[i]; y[i]=Y[i]; } return solve(); } int updateX(int pos, int val) { x[pos]=val; return solve(); } int updateY(int pos, int val) { y[pos]=val; return solve(); }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:26:17: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   26 |     return solve();
      |            ~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:30:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   30 |  return solve();
      |         ~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:35:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   35 |  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...