Submission #586826

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5868262022-06-30 17:56:46InternetPerson10Horses (IOI15_horses)C++17
100 / 100
572 ms94384 KiB
#include "horses.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007;
vector<int> x, y;
set<int> nonOnes;
ll modpow(ll n, ll e = MOD - 2) {
if(e == 0) return 1;
ll g = modpow(n, e/2);
g *= g;
g %= MOD;
if(e%2) {
g *= n;
g %= MOD;
}
return g;
}
struct SegTree {
int lx, rx;
int val = 0;
SegTree *ls, *rs;
SegTree(int l, int r) : lx(l), rx(r) {
if(rx - lx != 1) {
int mid = (lx + rx) / 2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int recalc()':
horses.cpp:57:29: warning: conversion from 'std::vector<int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   57 |     int rightBorder = x.size();
      |                       ~~~~~~^~
horses.cpp:64:64: warning: conversion from '__int128' to 'll' {aka 'long long int'} may change value [-Wconversion]
   64 |             __int128 best = -1, base = (prod * modpow(currProd % MOD)) % MOD;
      |                                                       ~~~~~~~~~^~~~~
#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...