Submission #597134

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5971342022-07-15 14:35:25PiejanVDCHorses (IOI15_horses)C++17
17 / 100
1591 ms74888 KiB
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
vector<long long>x,y;
long long mod = (long long)1000000007;
int last;
int ans;
int l,r;
vector<long long>mul(8*500000), correct_mul(8*500000);
void build(int i, int j, int p) {
if(i == j) {
mul[p] = correct_mul[p] = x[i];
return;
}
int mid = (i+j)/2;
build(i, mid, 2*p);
build(mid+1, j, 2*p+1);
mul[p] = mul[2*p] * mul[2*p+1];
mul[p] = min(mul[p], (long long)1e9+5);
correct_mul[p] = correct_mul[2*p] * correct_mul[2*p+1];
correct_mul[p] %= mod;
}
long long get_mul(int i, int j, int p) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int updX(int)':
horses.cpp:65:19: warning: conversion from 'std::vector<long long int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   65 |     int n = x.size();
      |             ~~~~~~^~
horses.cpp: In function 'int updY(int)':
horses.cpp:79:19: warning: conversion from 'std::vector<long long int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   79 |     int n = x.size();
      |             ~~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:145:9: warning: unused variable 'n' [-Wunused-variable]
  145 |     int n = (int)x.size();
      |         ^
horses.cpp: In function 'int updX(int)':
horses.cpp:74:1: warning: control reaches end of non-void function [-Wreturn-type]
   74 | }
      | ^
#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...