Submission #97885

#TimeUsernameProblemLanguageResultExecution timeMemory
97885someone_aaHorses (IOI15_horses)C++17
17 / 100
23 ms11392 KiB
#include "horses.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int maxn = 100100; const ll mod = 1e9 + 7; ll x[maxn], y[maxn], n; int solve() { ll h = 1LL; ll result = 0LL; for(int i=0;i<n;i++) { h *= 1LL * x[i]; h %= mod; ll temp = (h * 1LL * y[i]) % mod; result = max(result, temp); } return result; } 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 solve()':
horses.cpp:18:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return result;
            ^~~~~~
#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...