Submission #1000081

# Submission time Handle Problem Language Result Execution time Memory
1000081 2024-06-16T15:37:33 Z jer033 Horses (IOI15_horses) C++17
0 / 100
1500 ms 14292 KB
#include "horses.h"
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const ll MOD = 1'000'000'007;

int init(int N, int X[], int Y[]) {
	vector<ll> x(N);
	vector<ll> y(N);
	for (int i=0; i<N; i++)
	{
		x[i] = X[i];
		y[i] = Y[i];
	}
	ll best = 0;
	for (int i=0; i<N; i++)
	{
		ll curr = 1;
		for (int j=0; j<=i; j++)
			curr = curr*x[i];
		curr = curr*y[i];
		best = max(best, curr);
	}
	ll ans = best%MOD;
	return ans;
}

int updateX(int pos, int val) {	
	return 0;
}

int updateY(int pos, int val) {
	return 0;
}

Compilation message

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:25:9: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   25 |  return ans;
      |         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:28:17: warning: unused parameter 'pos' [-Wunused-parameter]
   28 | int updateX(int pos, int val) {
      |             ~~~~^~~
horses.cpp:28:26: warning: unused parameter 'val' [-Wunused-parameter]
   28 | int updateX(int pos, int val) {
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:32:17: warning: unused parameter 'pos' [-Wunused-parameter]
   32 | int updateY(int pos, int val) {
      |             ~~~~^~~
horses.cpp:32:26: warning: unused parameter 'val' [-Wunused-parameter]
   32 | int updateY(int pos, int val) {
      |                      ~~~~^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1584 ms 14292 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 440 KB Output is correct
2 Incorrect 0 ms 432 KB Output isn't correct
3 Halted 0 ms 0 KB -