Submission #135328

#TimeUsernameProblemLanguageResultExecution timeMemory
135328BoxworldHorses (IOI15_horses)C++14
17 / 100
1564 ms8584 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; const int bigint=1e9+7; struct year{int x,y;}a[500100]; long long ans,ho; int n; int init(int N, int X[], int Y[]){ n=N; int ho; for (int i=0;i<n;i++){a[i].x=X[i];a[i].y=Y[i];} ho=1;ans=0; for (int i=0;i<n;i++){ ho*=a[i].x; if (ans<ho*a[i].y)ans=ho*a[i].y; } return ans%bigint; } int updateX(int pos, int val) { a[pos].x=val; ho=1;ans=0; for (int i=0;i<n;i++){ ho*=a[i].x; if (ans<ho*a[i].y)ans=ho*a[i].y; } return ans%bigint; } int updateY(int pos, int val) { a[pos].y=val; ho=1;ans=0; for (int i=0;i<n;i++){ ho*=a[i].x; if (ans<ho*a[i].y)ans=ho*a[i].y; } return ans%bigint; }

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:10:9: warning: declaration of 'ho' shadows a global declaration [-Wshadow]
     int ho;
         ^~
horses.cpp:6:15: note: shadowed declaration is here
 long long ans,ho;
               ^~
horses.cpp:17:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:27:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:37:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
  return ans%bigint;
         ~~~^~~~~~~
#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...