Submission #437981

#TimeUsernameProblemLanguageResultExecution timeMemory
437981illyakrHorses (IOI15_horses)C++14
17 / 100
1579 ms12044 KiB
#include <bits/stdc++.h> #include "horses.h" using namespace std; #define ll long long const ll mod = 1000000007; ll n; ll x[501010], y[501010]; int init(int N, int X[], int Y[]) { n = N; for (ll i = 0; i < n; i++) { x[i] = X[i] % mod; y[i] = Y[i] % mod; } ll ans = 0, cnt = 1; for (ll i = 0; i < n; i++) { cnt *= x[i]; cnt %= mod; ans = max(ans, y[i] * cnt); ans %= mod; } return ans % mod; } int updateX(int pos, int val) { x[pos] = val % mod; ll ans = 0, cnt = 1; for (ll i = 0; i < n; i++) { cnt *= x[i]; cnt %= mod; ans = max(ans, y[i] * cnt); ans %= mod; } return ans % mod; } int updateY(int pos, int val) { y[pos] = val % mod; ll ans = 0, cnt = 1; for (ll i = 0; i < n; i++) { cnt *= x[i]; cnt %= mod; ans = max(ans, y[i] * cnt); ans %= mod; } return ans % mod; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:21:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   21 |  return ans % mod;
      |         ~~~~^~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:32:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   32 |  return ans % mod;
      |         ~~~~^~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:43:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   43 |  return ans % mod;
      |         ~~~~^~~~~
#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...