Submission #1039795

#TimeUsernameProblemLanguageResultExecution timeMemory
1039795c2zi6Horses (IOI15_horses)C++14
17 / 100
23 ms14160 KiB
#define _USE_MATH_DEFINES #include <bits/stdc++.h> #define ff first #define ss second #define pb push_back #define all(a) (a).begin(), (a).end() #define replr(i, a, b) for (int i = int(a); i <= int(b); ++i) #define reprl(i, a, b) for (int i = int(a); i >= int(b); --i) #define rep(i, n) for (int i = 0; i < int(n); ++i) #define mkp(a, b) make_pair(a, b) using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> PII; typedef vector<int> VI; typedef vector<PII> VPI; typedef vector<VI> VVI; typedef vector<VVI> VVVI; typedef vector<VPI> VVPI; typedef pair<ll, ll> PLL; typedef vector<ll> VL; typedef vector<PLL> VPL; typedef vector<VL> VVL; typedef vector<VVL> VVVL; typedef vector<VPL> VVPL; template<class T> T setmax(T& a, T b) {if (a < b) return a = b; return a;} template<class T> T setmin(T& a, T b) {if (a < b) return a; return a = b;} #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template<typename T> using indset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; #include "horses.h" const ll MOD = 1e9 + 7; int init(int N, int X[], int Y[]) { int n = N; VL a, b; a = b = VL(n); rep(i, n) { a[i] = X[i]; b[i] = Y[i]; } ll ans = 0; ll prod = 1; rep(i, n) { prod *= a[i]; setmax(ans, prod * b[i]); } return ans%MOD; } int updateX(int pos, int val) { return 0; } int updateY(int pos, int val) { return 0; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:50:12: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   50 |  return ans%MOD;
      |         ~~~^~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:53:17: warning: unused parameter 'pos' [-Wunused-parameter]
   53 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:53:26: warning: unused parameter 'val' [-Wunused-parameter]
   53 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:57:17: warning: unused parameter 'pos' [-Wunused-parameter]
   57 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:57:26: warning: unused parameter 'val' [-Wunused-parameter]
   57 | int updateY(int pos, int val) {
      |                      ~~~~^~~
#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...