Submission #424430

#TimeUsernameProblemLanguageResultExecution timeMemory
424430OzyHorses (IOI15_horses)C++17
17 / 100
14 ms8388 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define repa(i,a,b) for (int i = (a); i >= (b); i--) #define lli long long int #define debugsl(a) cout << #a << " = " << a << ", " #define debug(a) cout << #a << " = " << a << endl lli x[1002],y[1002],n,MAX,a; int init(int N, int X[], int Y[]) { n = N; MAX = 0; rep (i,0,n-1) { if (i > 0) x[i] = X[i] * x[i-1]; else x[i] = X[i]; y[i] = Y[i]; a = x[i] * y[i]; if (a > MAX) MAX = a; } return MAX; } int updateX(int pos, int val) { lli pas = x[pos]; MAX = 0; rep(i,0,n-1) { if (i >= pos){ x[i] /= pas; x[i] *= val; } a = x[i]*y[i]; if (a > MAX) MAX = a; } return MAX; } int updateY(int pos, int val) { MAX = 0; rep(i,0,n-1) { if (i == pos) y[i] = val; a = x[i]*y[i]; if (a > MAX) MAX = a; } return MAX; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:27:12: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   27 |     return MAX;
      |            ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:44:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   44 |  return MAX;
      |         ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:57:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   57 |  return MAX;
      |         ^~~
#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...