Submission #999524

#TimeUsernameProblemLanguageResultExecution timeMemory
999524AlfraganusHorses (IOI15_horses)C++17
17 / 100
1576 ms9164 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; vector<int> x, y; int init(int n, int X[], int Y[]) { for(int i = 0; i < n; i ++) x.push_back(X[i]); for(int i = 0; i < n; i ++) y.push_back(Y[i]); long long ans = 1, p = 1; for(int i = 0; i < n; i ++){ p = p * x[i]; ans = (max(ans, p * y[i])) % mod; p %= mod; } int res = ans; return res; } int updateX(int pos, int val) { x[pos] = val; long long ans = 1, p = 1; for(int i = 0; i < (int)x.size(); i ++) p = p * x[i], ans = (max(ans, p * y[i])) % mod, p %= mod; int res = ans; return res; } int updateY(int pos, int val) { y[pos] = val; long long ans = 1, p = 1; for(int i = 0; i < (int)y.size(); i ++) p = p * x[i], ans = (max(ans, p * y[i])) % mod, p %= mod; int res = ans; return res; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:19:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   19 |  int res = ans;
      |            ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:28:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   28 |  int res = ans;
      |            ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:37:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   37 |  int res = 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...